cloud-fan commented on code in PR #48795:
URL: https://github.com/apache/spark/pull/48795#discussion_r1839185018


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -142,17 +142,18 @@ class AstBuilder extends DataTypeAstBuilder
   }
 
   override def visitSingleCompoundStatement(ctx: 
SingleCompoundStatementContext): CompoundBody = {
-    visit(ctx.beginEndCompoundBlock()).asInstanceOf[CompoundBody]
+    val seenLabels = Set[String]()

Review Comment:
   Yes this is the implementation I was expecting. Can we do a bit more 
encapsulation? e.g.
   ```
   val labelCtx = new ScritpingLabelContext()
   visitBeginEndCompoundBlockImpl...
   ...
   class ScritpingLabelContext {
     private val seenLabels = Set[String]()
     
     def newLabel(label: String)...
     ...
   }
   ``



-- 
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