cloud-fan commented on a change in pull request #26434: [SPARK-29544] [SQL]
optimize skewed partition based on data size
URL: https://github.com/apache/spark/pull/26434#discussion_r358057881
##########
File path:
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/ReduceNumShufflePartitions.scala
##########
@@ -107,12 +116,14 @@ case class ReduceNumShufflePartitions(conf: SQLConf)
extends Rule[SparkPlan] {
}
/**
- * Estimates partition start indices for post-shuffle partitions based on
- * mapOutputStatistics provided by all pre-shuffle stages.
+ * Estimates partition start and end indices for post-shuffle partitions
based on
+ * mapOutputStatistics provided by all pre-shuffle stages and skip the
omittedPartitions
+ * already handled in skewed partition optimization.
*/
// visible for testing.
- private[sql] def estimatePartitionStartIndices(
- mapOutputStatistics: Array[MapOutputStatistics]): Array[Int] = {
+ private[sql] def estimatePartitionStartAndEndIndices(
+ mapOutputStatistics: Array[MapOutputStatistics],
+ excludedPartitions: Set[Int] = Set.empty): Array[(Int, Int)] = {
val minNumPostShufflePartitions = conf.minNumPostShufflePartitions
Review comment:
I think this should be `conf.minNumPostShufflePartitions -
excludedPartitions.length`
----------------------------------------------------------------
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]