cloud-fan commented on a change in pull request #25204:
[SPARK-28441][SQL][Python] Fix error when PythonUDF is used in correlated
scalar subquery
URL: https://github.com/apache/spark/pull/25204#discussion_r306346358
##########
File path:
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala
##########
@@ -344,7 +365,20 @@ object RewriteCorrelatedScalarSubquery extends
Rule[LogicalPlan] {
case _: AttributeReference => Literal.default(NullType)
}
- Option(rewrittenExpr.eval())
+
+ // Removes Alias over given expression, because Alias is not foldable.
+ if (!removeAlias(rewrittenExpr).foldable) {
Review comment:
seems like we can move the following code into a common method?
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]