{
  "id": "data/avro-schema-evolution-field-type-change",
  "signature": "Avro schema evolution fails when field type changes from int to long",
  "signature_zh": "Avro模式演变在字段类型从int变为long时失败",
  "regex": "Avro schema evolution fails when field type changes from int to long",
  "domain": "data",
  "category": "schema_error",
  "subcategory": null,
  "root_cause": "Avro schema evolution does not allow changing a field's type from int to long without a custom conversion, as it violates backward compatibility rules.",
  "root_cause_type": "generic",
  "root_cause_zh": "Avro模式演变不允许将字段类型从int改为long而没有自定义转换，因为这违反了向后兼容性规则。",
  "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": "",
      "why_fails": "Simply adding a default value to the field does not resolve the type change issue because Avro checks the type compatibility first.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deleting and recreating the schema entirely breaks existing data streams and requires reprocessing all historical data.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Define a new field with the target type (e.g., 'new_field' as long) and deprecate the old field. Update producers to write to the new field and consumers to read from both.",
      "success_rate": 0.85,
      "how": "Define a new field with the target type (e.g., 'new_field' as long) and deprecate the old field. Update producers to write to the new field and consumers to read from both.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a custom logical type conversion in the schema registry to handle int-to-long promotion, e.g., by setting `avro.schema.conversion` property.",
      "success_rate": 0.7,
      "how": "Use a custom logical type conversion in the schema registry to handle int-to-long promotion, e.g., by setting `avro.schema.conversion` property.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Define a new field with the target type (e.g., 'new_field' as long) and deprecate the old field. Update producers to write to the new field and consumers to read from both.",
    "Use a custom logical type conversion in the schema registry to handle int-to-long promotion, e.g., by setting `avro.schema.conversion` property."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://avro.apache.org/docs/current/spec.html#Schema+Evolution",
  "official_doc_section": null,
  "error_code": "AVRO_SCHEMA_EVOLUTION_TYPE_MISMATCH",
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.75,
  "resolvable": "partial",
  "first_seen": "2023-08-20",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}