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


##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1032,6 +1044,42 @@ object ColumnPruning extends Rule[LogicalPlan] {
         p
       }
 
+    case p @ Project(_, ul: UnionLoop) =>
+      if (!ul.outputSet.subsetOf(p.references)) {

Review Comment:
   How can this be true? The analyzer guarantees that all the references of a 
plan node come from its children nodes. So `ul.outputSet` must be a super set 
of `p.references`.



##########
sql/catalyst/src/main/scala/org/apache/spark/sql/catalyst/optimizer/Optimizer.scala:
##########
@@ -1032,6 +1044,42 @@ object ColumnPruning extends Rule[LogicalPlan] {
         p
       }
 
+    case p @ Project(_, ul: UnionLoop) =>
+      if (!ul.outputSet.subsetOf(p.references)) {

Review Comment:
   How can this be false? The analyzer guarantees that all the references of a 
plan node come from its children nodes. So `ul.outputSet` must be a super set 
of `p.references`.



-- 
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: reviews-unsubscr...@spark.apache.org

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