{
  "id": "data/avro-schema-field-missing-default",
  "signature": "Avro deserialization fails: field 'email' has no default and is missing in writer schema",
  "signature_zh": "Avro 反序列化失败：字段 'email' 没有默认值且在写入器模式中缺失",
  "regex": "(?i)(field.*not set and has no default|AvroTypeException.*no default)",
  "domain": "data",
  "category": "schema_error",
  "subcategory": null,
  "root_cause": "Avro reader schema has a field with no default value that is not present in the writer schema, violating forward compatibility.",
  "root_cause_type": "generic",
  "root_cause_zh": "Avro 读取器模式中有一个没有默认值的字段，该字段在写入器模式中不存在，违反了前向兼容性。",
  "versions": [
    {
      "version": "Apache Avro 1.11.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Confluent Schema Registry 7.5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Adding the missing field to the writer schema",
      "why_fails": "This requires coordination with all data producers and may not be feasible for historical data.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "Setting the field as 'optional' using union [null, string] in reader schema",
      "why_fails": "This changes the field type and may break downstream consumers expecting a non-nullable string.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Add a default value to the reader schema field: e.g., {\"name\": \"email\", \"type\": \"string\", \"default\": \"\"}",
      "success_rate": 0.95,
      "how": "Add a default value to the reader schema field: e.g., {\"name\": \"email\", \"type\": \"string\", \"default\": \"\"}",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use Avro's projection API to filter out unknown fields during deserialization: SpecificDatumReader<MyClass> reader = new SpecificDatumReader<>(writerSchema, readerSchema, new NoMatchFieldAction());",
      "success_rate": 0.8,
      "how": "Use Avro's projection API to filter out unknown fields during deserialization: SpecificDatumReader<MyClass> reader = new SpecificDatumReader<>(writerSchema, readerSchema, new NoMatchFieldAction());",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Add a default value to the reader schema field: e.g., {\"name\": \"email\", \"type\": \"string\", \"default\": \"\"}",
    "Use Avro's projection API to filter out unknown fields during deserialization: SpecificDatumReader<MyClass> reader = new SpecificDatumReader<>(writerSchema, readerSchema, new NoMatchFieldAction());"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://avro.apache.org/docs/current/spec.html#Schema+Resolution",
  "official_doc_section": null,
  "error_code": "org.apache.avro.AvroTypeException: Field email type:STRING pos:12 not set and has no default value",
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-05-22",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}