You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/03/11 17:12:06 UTC

[GitHub] [spark] dongjoon-hyun commented on a change in pull request #27879: [SPARK-31124][SQL] change the default value of minPartitionNum in AQE

dongjoon-hyun commented on a change in pull request #27879: [SPARK-31124][SQL] change the default value of minPartitionNum in AQE
URL: https://github.com/apache/spark/pull/27879#discussion_r391129740
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CoalesceShufflePartitions.scala
 ##########
 @@ -66,12 +68,16 @@ case class CoalesceShufflePartitions(conf: SQLConf) extends Rule[SparkPlan] {
       val distinctNumPreShufflePartitions =
         validMetrics.map(stats => stats.bytesByPartitionId.length).distinct
       if (validMetrics.nonEmpty && distinctNumPreShufflePartitions.length == 1) {
+        // To avoid perf regression, we by default set the minimum number of coalesced partitions
+        // to Spark default parallelism, so that we don't keep CPU cores idle.
+        val minPartitionNum = conf.getConf(SQLConf.COALESCE_PARTITIONS_MIN_PARTITION_NUM)
+          .getOrElse(session.sparkContext.defaultParallelism)
 
 Review comment:
   This is the reason why we need `session` instead of `conf`?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org