[SPARK-57243] Wrap IsNull and IsNotNull in brackets for V2 SQL builder#56296
Open
milastdbx wants to merge 4 commits into
Open
[SPARK-57243] Wrap IsNull and IsNotNull in brackets for V2 SQL builder#56296milastdbx wants to merge 4 commits into
milastdbx wants to merge 4 commits into
Conversation
uros-b
reviewed
Jun 3, 2026
uros-b
reviewed
Jun 3, 2026
uros-b
reviewed
Jun 3, 2026
uros-b
approved these changes
Jun 3, 2026
Member
uros-b
left a comment
There was a problem hiding this comment.
Thank you for addressing all comments @milastdbx! Waiting for CI.
Contributor
Author
thanks @uros-b for review. I've added integration tests as well |
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?
In this PR i propose we update V2 SQL builder logic to be more safe and wrap child of IsNull in paranethisis if child itself has more than 1 child.
This way we are safer from perspective of operator precedence.
Some dialects such as snowflake for example treat
IS NULLas higher precedence than equality and hence can lead to correctness issues or failed queries.Why are the changes needed?
To increase robustness of dialects inheriting this SQL builder
Does this PR introduce any user-facing change?
No
How was this patch tested?
H2 Integration test.
Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Code
Co-authored via Claude Code