[SPARK-50491][SQL] Fix bug where empty BEGIN END blocks throw an error#49064
Closed
dusantism-db wants to merge 3 commits intoapache:masterfrom
Closed
[SPARK-50491][SQL] Fix bug where empty BEGIN END blocks throw an error#49064dusantism-db wants to merge 3 commits intoapache:masterfrom
dusantism-db wants to merge 3 commits intoapache:masterfrom
Conversation
813f785 to
5bc7482
Compare
miland-db
approved these changes
Dec 6, 2024
Contributor
|
Good job on testing different |
dejankrak-db
reviewed
Dec 6, 2024
dejankrak-db
approved these changes
Dec 6, 2024
davidm-db
approved these changes
Dec 6, 2024
a268135 to
55a679d
Compare
Contributor
|
This approach LGTM, but do you know why |
Contributor
Author
@cloud-fan |
cloud-fan
approved these changes
Dec 10, 2024
Contributor
|
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.
This PR depends on #48989
What changes were proposed in this pull request?
There is a bug in SQL scripting which causes empty compound statements to throw an error if their body consists solely of empty BEGIN END blocks. Examples:
This PR fixes this by introducing a NO-OP statement for SQL scripting, which empty BEGIN END blocks will return.
Why are the changes needed?
Currenty, compound bodies declare they have the next element even if their body is consisted only of empty blocks. This is because it only checks for existence of statements in the body, not whether there is at least one statement which is not an empty block.
Does this PR introduce any user-facing change?
No.
How was this patch tested?
Unit tests were added to existing suites.
Was this patch authored or co-authored using generative AI tooling?
No.