cloud-fan commented on code in PR #39010:
URL: https://github.com/apache/spark/pull/39010#discussion_r1046606606
##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/expressions/EquivalentExpressions.scala:
##########
@@ -142,28 +142,37 @@ class EquivalentExpressions {
case _ => Nil
}
+ private def supportedExpression(e: Expression) = {
+ !e.exists {
+ // `LambdaVariable` is usually used as a loop variable, which can't be
evaluated ahead of the
+ // loop. So we can't evaluate sub-expressions containing
`LambdaVariable` at the beginning.
+ case _: LambdaVariable => true
Review Comment:
I just noticed that there is a `NamedLambdaVariable`, shall we match it as
well?
--
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]