Open corentinghigny opened 4 years ago
This still needs works : a lot of TODO and FIXME were put in nearly every avro type test I'd like some help on those because I have deadlines coming around :sweat:
Also, missingDefaultIsNull
is a lame variable name, some ideas for a better one ?
I don't even remember why, but while working on avro compatibility check, we found out strange behaviour by the parser if it encounter null value while parsing String. While trying to fix that, a lot of stuff popped out.
We used that opportunity to fix handling of "null" and implement "default" field value (avro spec). We also added a parameter "missingDefaultIsNull", that put "null" as "default" if no default is given
More info on why this is needed on https://issues.apache.org/jira/browse/AVRO-1803 (no "null" default means that if key isn't found in the record, the record is invalid)
This parameter is "true" by default for simplicity and avoid breaking compatibility
It SHOULD not break anything, UT still works, but it might, has before, in the
fromMap
method ofAvroConverter
, the only line wasthis didn't check if the key existed in the record,
Map().get()
returns null if the key doesn't exist