cloud-fan commented on a change in pull request #26409: [SPARK-29655][SQL] Read 
bucketed tables obeys spark.sql.shuffle.partitions
URL: https://github.com/apache/spark/pull/26409#discussion_r346306732
 
 

 ##########
 File path: 
sql/core/src/main/scala/org/apache/spark/sql/execution/exchange/EnsureRequirements.scala
 ##########
 @@ -83,7 +83,19 @@ case class EnsureRequirements(conf: SQLConf) extends 
Rule[SparkPlan] {
         numPartitionsSet.headOption
       }
 
-      val targetNumPartitions = 
requiredNumPartitions.getOrElse(childrenNumPartitions.max)
+      // Read bucketed tables always obeys numShufflePartitions because 
maxNumPostShufflePartitions
+      // is usually much larger than numShufflePartitions,
+      // which causes some bucket map join lose efficacy after enabling 
adaptive execution.
 
 Review comment:
   The comment is hard to understand. How about
   ```
   If there are non-shuffle children that satisfy the required distribution, we 
have some tradeoffs
   when picking the expected number of shuffle partitions:
   1. we should avoid shuffling these children
   2. we should have a reasonable parallelism
   
   Here we pick the max number of partitions among these non-shuffle children 
as the expected number
   of shuffle partitions. However, if it's smaller than 
`conf.numShufflePartitions`, we pick 
   `conf.numShufflePartitions` as the expected number of shuffle partitions.
   ```

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to