cloud-fan commented on a change in pull request #35715:
URL: https://github.com/apache/spark/pull/35715#discussion_r820813915



##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/DynamicJoinSelection.scala
##########
@@ -50,10 +52,41 @@ object DynamicJoinSelection extends Rule[LogicalPlan] {
       mapStats.bytesByPartitionId.forall(_ <= 
maxShuffledHashJoinLocalMapThreshold)
   }
 
-  private def selectJoinStrategy(plan: LogicalPlan): Option[JoinStrategyHint] 
= plan match {
+  private def selectJoinStrategy(
+      join: Join,
+      plan: LogicalPlan): Option[JoinStrategyHint] = plan match {
     case LogicalQueryStage(_, stage: ShuffleQueryStageExec) if 
stage.isMaterialized
       && stage.mapStats.isDefined =>
-      val demoteBroadcastHash = 
shouldDemoteBroadcastHashJoin(stage.mapStats.get)
+
+      val manyEmptyInPlan = shouldDemoteBroadcastHashJoin(stage.mapStats.get)

Review comment:
       seems we can rename the method from `shouldDemoteBroadcastHashJoin` to 
`shouldDemoteBroadcastHashJoin`

##########
File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/DynamicJoinSelection.scala
##########
@@ -50,10 +52,41 @@ object DynamicJoinSelection extends Rule[LogicalPlan] {
       mapStats.bytesByPartitionId.forall(_ <= 
maxShuffledHashJoinLocalMapThreshold)
   }
 
-  private def selectJoinStrategy(plan: LogicalPlan): Option[JoinStrategyHint] 
= plan match {
+  private def selectJoinStrategy(
+      join: Join,
+      plan: LogicalPlan): Option[JoinStrategyHint] = plan match {
     case LogicalQueryStage(_, stage: ShuffleQueryStageExec) if 
stage.isMaterialized
       && stage.mapStats.isDefined =>
-      val demoteBroadcastHash = 
shouldDemoteBroadcastHashJoin(stage.mapStats.get)
+
+      val manyEmptyInPlan = shouldDemoteBroadcastHashJoin(stage.mapStats.get)

Review comment:
       seems we can rename the method from `shouldDemoteBroadcastHashJoin` to 
`hasManyEmptyPartitions`




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