forked from apache/spark
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SPARK-48358][SQL] Support for REPEAT statement
### What changes were proposed in this pull request? In this PR, support for REPEAT statement in SQL scripting is introduced. Changes summary: Grammar/parser changes - `repeatStatement` grammar rule - `visitRepeatStatement` rule visitor - `RepeatStatement` logical operetor `RepeatStatementExec` execution node Internal sates - `Condition` and `Body` Iterator implementation - switch between body and condition until condition evaluates to true SqlScriptingInterpreter - added logic to transform RepeatStatement logical operator to RepeatStatementExec execution node ### Why are the changes needed? This is a part of SQL Scripting introduced to Spark, REPEAT statement is a basic control flow construct in the SQL language. ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? New tests are introduced to all of the three scripting test suites: `SqlScriptingParserSuite`, `SqlScriptingExecutionNodeSuite` and `SqlScriptingInterpreterSuite`. ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#47756 from dusantism-db/sql-scripting-repeat-statement. Authored-by: Dušan Tišma <[email protected]> Signed-off-by: Max Gekk <[email protected]>
- Loading branch information
1 parent
6d8b842
commit da89322
Showing
13 changed files
with
872 additions
and
25 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.