[SPARK-50906][SQL][SS] Add nullability check for if inputs of to_avro align with schema#49590
Closed
fanyue-xia wants to merge 9 commits intoapache:masterfrom
Closed
[SPARK-50906][SQL][SS] Add nullability check for if inputs of to_avro align with schema#49590fanyue-xia wants to merge 9 commits intoapache:masterfrom
fanyue-xia wants to merge 9 commits intoapache:masterfrom
Conversation
3291312 to
6052ce8
Compare
MaxGekk
reviewed
Jan 22, 2025
connector/avro/src/test/scala/org/apache/spark/sql/avro/AvroCatalystDataConversionSuite.scala
Outdated
Show resolved
Hide resolved
sql/core/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala
Outdated
Show resolved
Hide resolved
6052ce8 to
93e8a4b
Compare
01e48be to
d5ad9b1
Compare
d5ad9b1 to
8fbda34
Compare
sql/core/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala
Outdated
Show resolved
Hide resolved
132c0af to
128865c
Compare
2ae4fb3 to
f9ecebd
Compare
7e78013 to
fa5a1cf
Compare
gengliangwang
approved these changes
Jan 28, 2025
Member
gengliangwang
left a comment
There was a problem hiding this comment.
LGTM except one comment
sql/core/src/main/scala/org/apache/spark/sql/avro/AvroSerializer.scala
Outdated
Show resolved
Hide resolved
1fe92a8 to
f06e498
Compare
gengliangwang
approved these changes
Jan 29, 2025
Member
|
Thanks, merging to master! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Previously, we don't explicitly check when input of
to_avroisnullbut the schema does not allownull. As a result, a NPE will be raised in this situation. This PR adds the check during serialization before writing to avro and raises user-facing error if above occurs.Why are the changes needed?
It makes it easier for the user to understand and face the error.
Does this PR introduce any user-facing change?
No
How was this patch tested?
Unit test
Was this patch authored or co-authored using generative AI tooling?
No