-
Notifications
You must be signed in to change notification settings - Fork 194
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
Improved Avro error reporting related to schemas #3110
Improved Avro error reporting related to schemas #3110
Conversation
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.
LG - The only feedback I have are stylistic based on the code clean up you have already done.
@@ -179,6 +176,9 @@ private GenericRecord buildAvroRecord(final Schema schema, final Map<String, Obj | |||
continue; | |||
} | |||
final Schema.Field field = schema.getField(key); | |||
if(field == null) { |
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.
(Only because you fixed other spacing issues in this PR)
You are missing a space after the if
if (field == null) {
final Map<String, Object> stringObjectMap = objectMapper.readValue(s3Object, new TypeReference<>() { | ||
}); |
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.
Was this change intentional to split into two lines?
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 is what my IntelliJ formatter produced.
...avro-codecs/src/main/java/org/opensearch/dataprepper/plugins/codec/avro/AvroOutputCodec.java
Outdated
Show resolved
Hide resolved
…exception when an Avro field is missing from the schema. Signed-off-by: David Venable <dlv@amazon.com>
f386b42
to
1eb7926
Compare
Signed-off-by: David Venable <dlv@amazon.com>
I had to rebase and force push due to changes from #3122. Please take another look. Thanks! |
Description
This PR has two major updates:
Additionally, this PR includes some code clean-up.
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.