wankunde commented on code in PR #38176:
URL: https://github.com/apache/spark/pull/38176#discussion_r996650693


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/DynamicJoinSelection.scala:
##########
@@ -89,13 +111,19 @@ object DynamicJoinSelection extends Rule[LogicalPlan] with 
JoinSelectionHelper {
           false
         }
 
-        val preferShuffleHash = preferShuffledHashJoin(stage.mapStats.get)
+        val preferShuffleHash = streamedPlan match {
+          case LogicalQueryStage(_, streamedStage: ShuffleQueryStageExec)
+            if streamedStage.isMaterialized && 
streamedStage.mapStats.isDefined =>
+            preferShuffledHashJoin(stage.mapStats.get, 
streamedStage.mapStats.get)
+
+          case _ => false

Review Comment:
   Fix, could you help to review this PR again? 
   
   Thanks 



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