-
Notifications
You must be signed in to change notification settings - Fork 28.3k
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
[SPARK-48150][SQL] try_parse_json output should be declared as nullable #46409
Conversation
cc @harshmotw-db and @cloud-fan from #46141 |
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 was an oversight. Thanks for the fix!
According to the CI result, maybe
|
It's not flaky, it's a legitimate test failure:
|
Wow! Thank you for the fix. |
Merged to master for Apache Spark 4.0.0-preview. Thank you, @JoshRosen and all. |
### What changes were proposed in this pull request? The `try_parse_json` expression added in apache#46141 declares improper output nullability: the `try_` version's output must be marked as nullable. This PR corrects the nullability and adds a test. ### Why are the changes needed? Incorrectly declaring an expression's output as non-nullable when it is actually nullable may lead to crashes. ### Does this PR introduce _any_ user-facing change? Yes, it affects output nullability and thus may affect query result schemas. ### How was this patch tested? New unit test cases. ### Was this patch authored or co-authored using generative AI tooling? No. Closes apache#46409 from JoshRosen/fix-try-parse-json-nullability. Authored-by: Josh Rosen <joshrosen@databricks.com> Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
What changes were proposed in this pull request?
The
try_parse_json
expression added in #46141 declares improper output nullability: thetry_
version's output must be marked as nullable. This PR corrects the nullability and adds a test.Why are the changes needed?
Incorrectly declaring an expression's output as non-nullable when it is actually nullable may lead to crashes.
Does this PR introduce any user-facing change?
Yes, it affects output nullability and thus may affect query result schemas.
How was this patch tested?
New unit test cases.
Was this patch authored or co-authored using generative AI tooling?
No.