miland-db commented on code in PR #47423:
URL: https://github.com/apache/spark/pull/47423#discussion_r1713627254


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/SqlScriptingLogicalOperators.scala:
##########
@@ -57,7 +60,40 @@ case class SingleStatement(parsedPlan: LogicalPlan)
  */
 case class CompoundBody(
     collection: Seq[CompoundPlanStatement],
-    label: Option[String]) extends CompoundPlanStatement
+    label: Option[String] = None,
+    handlers: Seq[ErrorHandler] = Seq.empty,
+    conditions: mutable.HashMap[String, String] = mutable.HashMap()) extends 
CompoundPlanStatement
+
+/**
+ * Logical operator for an error condition.
+ * @param conditionName Name of the error condition.
+ * @param value SQLSTATE or Error Code.
+ */
+case class ErrorCondition(
+    conditionName: String,
+    value: String) extends CompoundPlanStatement
+
+object HandlerType extends Enumeration {
+    type HandlerType = Value
+    val EXIT, CONTINUE = Value
+}
+
+/**
+ * Logical operator for an error condition.
+ * @param conditions Name of the error condition variable for which the 
handler is built.
+ * @param body CompoundBody of the handler.
+ * @param handlerType Type of the handler (CONTINUE or EXIT).
+ */
+case class ErrorHandler(
+    conditions: Seq[String],
+    body: CompoundBody,
+    handlerType: HandlerType) extends CompoundPlanStatement
+
+/**
+ * Logical operator for a leave statement.
+ * @param label Label of the CompoundBody leave statement should exit.
+ */
+case class BatchLeaveStatement(label: String) extends CompoundPlanStatement

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]

Reply via email to