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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/expressions.scala:
##########
@@ -52,22 +52,28 @@ object ConstantFolding extends Rule[LogicalPlan] {
     case _ => false
   }
 
+  private def constantFolding(e: Expression): Expression = e match {
+    // do not partially fold children inside ConditionalExpression
+    case c: ConditionalExpression if !c.foldable => c

Review Comment:
   Yea, we should use try-catch and keep doing constant folding on conditional 
expressions as long as they don't error out.



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