ulysses-you commented on code in PR #36468:
URL: https://github.com/apache/spark/pull/36468#discussion_r866699096
##########
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:
Ideally we can fold the `alwaysEvaluatedInputs` if it's foldable and replace
them with literal, but we need add a new method like `withNewChidlren` in
`ConditionalExpression`. It seems a little overkill. What do you think ?
@cloud-fan @viirya @HyukjinKwon
--
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]