# Avro deserialization fails: field 'email' has no default and is missing in writer schema

- **ID:** `data/avro-schema-field-missing-default`
- **Domain:** data
- **Category:** schema_error
- **Error Code:** `org.apache.avro.AvroTypeException: Field email type:STRING pos:12 not set and has no default value`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Avro reader schema has a field with no default value that is not present in the writer schema, violating forward compatibility.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Apache Avro 1.11.0 | active | — | — |
| Confluent Schema Registry 7.5.0 | active | — | — |

## Workarounds

1. **Add a default value to the reader schema field: e.g., {"name": "email", "type": "string", "default": ""}** (95% success)
   ```
   Add a default value to the reader schema field: e.g., {"name": "email", "type": "string", "default": ""}
   ```
2. **Use Avro's projection API to filter out unknown fields during deserialization: SpecificDatumReader<MyClass> reader = new SpecificDatumReader<>(writerSchema, readerSchema, new NoMatchFieldAction());** (80% success)
   ```
   Use Avro's projection API to filter out unknown fields during deserialization: SpecificDatumReader<MyClass> reader = new SpecificDatumReader<>(writerSchema, readerSchema, new NoMatchFieldAction());
   ```

## Dead Ends

- **Adding the missing field to the writer schema** — This requires coordination with all data producers and may not be feasible for historical data. (70% fail)
- **Setting the field as 'optional' using union [null, string] in reader schema** — This changes the field type and may break downstream consumers expecting a non-nullable string. (60% fail)
