avro-util
avro-util copied to clipboard
[fast-avro][deserializer] Populate methods always with 'customization' argument
Populate methods now always have 'customization' argument because deserialize-method(s) of nested records may generate another populate methods that require 'customization' (at least for compilation purposes).
This may happen when record is deserialized with schema having less fields (usually: older schema) AND populate_...()
helper method is generated on a field for which recordAction.getShouldRead() == false
, so a bit of bad-luck is also needed.
In the added unit-test, without fix the methods chain is:
deserialize(RecordWithOneNullableText reuse, Decoder decoder, DatumReaderCustomization customization)
--> deserializeRecordWithOneNullableText0((reuse), (decoder), (customization))
--> populate_RecordWithOneNullableTextAndDeeplyNestedRecord0((RecordWithOneNullableTextAndDeeplyNestedRecord), (customization), (decoder));
--> deserializeNestedRecord0(null, (decoder), (customization));
--> populate_NestedRecord0((decoder));
--> deserializeDeeplyNestedRecord0(null, (decoder), (customization)); // ! unknown 'customization' variable
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 46.21%. Comparing base (
2fd93ac
) to head (ff2c378
). Report is 3 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #557 +/- ##
============================================
- Coverage 46.24% 46.21% -0.04%
+ Complexity 4619 4591 -28
============================================
Files 412 410 -2
Lines 28679 28610 -69
Branches 4686 4677 -9
============================================
- Hits 13262 13221 -41
+ Misses 13834 13809 -25
+ Partials 1583 1580 -3
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @radai-rosenblatt , @FelixGV , @gaojieliu Would you be able to take a look at this fix?
Looks good to me and I am going to merge it and cut a new release. Thanks for the fix!
New release is out: https://github.com/linkedin/avro-util/releases/tag/0.4.17
Thank you @gaojieliu !