davidm-db commented on code in PR #47973:
URL: https://github.com/apache/spark/pull/47973#discussion_r1744481224
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -261,6 +261,54 @@ class AstBuilder extends DataTypeAstBuilder
WhileStatement(condition, body, Some(labelText))
}
+ private def leaveOrIterateContextHasLabel(
+ ctx: RuleContext, label: String, isLeave: Boolean): Boolean = {
+ ctx match {
+ case c: BeginEndCompoundBlockContext
+ if isLeave &&
Review Comment:
Done.
##########
sql/core/src/main/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNode.scala:
##########
@@ -326,3 +371,13 @@ class WhileStatementExec(
body.reset()
}
}
+
+class LeaveStatementExec(val label: String) extends LeafStatementExec {
+ var hasBeenMatched: Boolean = false
Review Comment:
Done.
##########
sql/core/src/test/scala/org/apache/spark/sql/scripting/SqlScriptingExecutionNodeSuite.scala:
##########
@@ -35,6 +35,10 @@ class SqlScriptingExecutionNodeSuite extends SparkFunSuite
with SharedSparkSessi
override def reset(): Unit = ()
}
+ case class TestLeaveStatement(labelText: String) extends
LeaveStatementExec(labelText)
+
+ case class TestIterateStatement(labelText: String) extends
IterateStatementExec(labelText)
Review Comment:
Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]