davidm-db commented on code in PR #47672:
URL: https://github.com/apache/spark/pull/47672#discussion_r1739403703


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/parser/AstBuilder.scala:
##########
@@ -229,6 +229,31 @@ class AstBuilder extends DataTypeAstBuilder
     )
   }
 
+  override def visitSearchedCaseStatement(ctx: SearchedCaseStatementContext)
+  : SearchedCaseStatement = {
+    SearchedCaseStatement(
+      conditions = ctx.conditions.asScala.toList.map(boolExpr => 
withOrigin(boolExpr) {
+        SingleStatement(
+          Project(
+            Seq(Alias(expression(boolExpr), "condition")()),
+            OneRowRelation()))
+      }),
+      conditionalBodies = ctx.conditionalBodies.asScala.toList.map(body => 
visitCompoundBody(body)),
+      elseBody = Option(ctx.elseBody).map(body => visitCompoundBody(body)))
+  }
+
+  override def visitSimpleCaseStatement(ctx: SimpleCaseStatementContext): 
SearchedCaseStatement = {

Review Comment:
   I'm not sure about this at the moment, let's think about it on Monday and 
try to figure out a better approach...



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