maropu commented on a change in pull request #29585:
URL: https://github.com/apache/spark/pull/29585#discussion_r493976424



##########
File path: 
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/subquery.scala
##########
@@ -458,7 +463,10 @@ object RewriteCorrelatedScalarSubquery extends 
Rule[LogicalPlan] {
         sys.error(s"Unexpected operator in scalar subquery: $lp")
     }
 
-    val resultMap = evalPlan(plan)
+    val resultMap = evalPlan(plan).mapValues { _.transform {
+        case a: Alias => a.newInstance() // Assigns a new `ExprId`

Review comment:
       I've checked that we don't need this change because of the same reason 
with https://github.com/apache/spark/pull/29585#discussion_r490318779. So, I've 
reverted it in the latest commit.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to