-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Behavioral change to Avro codecs and schema handling #3238
Behavioral change to Avro codecs and schema handling #3238
Conversation
…hema to get data, rather than iterate over the entire record. Fix Avro arrays which were only supporting arrays of strings previously. Signed-off-by: David Venable <[email protected]>
…ely on the schema rather than the incoming event. If the schema is auto-generated, then the incoming event data must continue to match. Signed-off-by: David Venable <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would be the behavior if the incoming events has less keys than the schema?
It depends on the schema. If the schema does not allow it to be This test should cover it: |
for (String key : getKeyNames(schema, eventData, codecContext, rootOfData)) { | ||
final Schema.Field field = schema.getField(key); | ||
if (field == null) { | ||
throw new RuntimeException("The event has a key ('" + key + "') which is not included in the schema."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the behavior for this exception? We include it as one of the Events that has to be dropped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will show in the sampled log as merged in #3242.
Change the behavior of Avro-based codecs. When a schema is defined, rely on the schema rather than the incoming event. If the schema is auto-generated, then the incoming event data must continue to match. Fix Avro arrays which were only supporting arrays of strings previously. Signed-off-by: David Venable <[email protected]> (cherry picked from commit f17e833)
Change the behavior of Avro-based codecs. When a schema is defined, rely on the schema rather than the incoming event. If the schema is auto-generated, then the incoming event data must continue to match. Fix Avro arrays which were only supporting arrays of strings previously. Signed-off-by: David Venable <[email protected]> (cherry picked from commit f17e833) Co-authored-by: David Venable <[email protected]>
Description
This PR makes a fundamental change to how the Avro-based codecs (Avro and Parquet) handle mapping Events to Avro records.
There are now two cases which are handled differently:
Issues Resolved
N/A
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.