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


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/AQEPropagateEmptyRelation.scala:
##########
@@ -82,6 +82,21 @@ object AQEPropagateEmptyRelation extends 
PropagateEmptyRelationBase {
     case _ => false
   }
 
+  // In AQE, query stage will be wrapped with LogicalQueryStage, if it's child 
is
+  // BroadcastQueryStage and join other side is empty relation like the follow 
plan:
+  // Join
+  //   :- LocalTableScan <empty>, [a#23]
+  //   +- LogicalQueryStage(_, BroadcastQueryStage)
+  // After AQEPropagateEmptyRelation, the plan will be
+  // Project
+  //   +- LogicalQueryStage(_, BroadcastQueryStage)
+  // Then after LogicalQueryStageStrategy, will only remain 
BroadcastQueryStage after project,
+  // the plan can't execute.

Review Comment:
   We can simply say
   ```
   // A broadcast query stage can't be executed without the join operator.
   // TODO: we can return the original query plan before broadcast.
   ```



-- 
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]

Reply via email to