Avro schema doesn't honor backward compatibilty

前端 未结 3 1904
甜味超标
甜味超标 2021-01-17 18:53

I have this avro schema

{
 \"namespace\": \"xx.xxxx.xxxxx.xxxxx\",
 \"type\": \"record\",
 \"name\": \"MyPayLoad\",
 \"fields\": [
     {\"name\": \"filed1\"         


        
3条回答
  •  长情又很酷
    2021-01-17 19:34

    I am facing this exact situation. Data written by the older schema fails when trying to read it with the newer schema. The newer schema has just one additional field with union and default set. "type":["null","string"],"doc":"","default":null

    In spite of setting default, the null doesn't get filled in automatically during reading. Both the writer and the reader schemas need to be provided during reading. My understanding was avro is backward compatible and it should be able to support newer columns without the need for the older schema.

提交回复
热议问题