dusantism-db commented on code in PR #48794:
URL: https://github.com/apache/spark/pull/48794#discussion_r1833139463
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -341,6 +351,10 @@ class AstBuilder extends DataTypeAstBuilder
if Option(c.beginLabel()).isDefined &&
c.beginLabel().multipartIdentifier().getText.toLowerCase(Locale.ROOT).equals(label)
=> true
+ case c: ForStatementContext
Review Comment:
I agree we need this refactor, however is it's not trivial as these classes
don't have a common superclass with `beginLabel() `method.
The syntax for what you're suggesting would be
```
case c @ (WhileStatementContext
| RepeatStatementContext
| LoopStatementContext
| ForStatementContext)
if Option(c.beginLabel()).isDefined &&
c.beginLabel().multipartIdentifier().getText.toLowerCase(Locale.ROOT).equals(label)
=> true
```
however this doesn't compile, due to the above reason. To add the superclass
with begin/end labels requires grammar changes, i think this is best done as a
separate task.
--
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]