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


##########
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:
   how hard is it to return the original query plan? Seems not hard as we just 
need to add a new `def returnSingleJoinSide` function in the base class, and 
unwrap broadcast stage in the AQE rule.



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