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 2022/08/17 02:45:15 UTC

[GitHub] [spark] wangyum commented on a diff in pull request #37451: [SPARK-40017][SQL] Adaptive adjustment `spark.sql.adaptive.advisoryPartitionSizeInBytes`

wangyum commented on code in PR #37451:
URL: https://github.com/apache/spark/pull/37451#discussion_r947399839


##########
sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CoalesceShufflePartitions.scala:
##########
@@ -163,6 +163,16 @@ case class CoalesceShufflePartitions(session: SparkSession) extends AQEShuffleRe
       }.getOrElse(plan)
     case other => other.mapChildren(updateShuffleReads(_, specsMap))
   }
+
+  // Adjust advisory partition size in bytes based on following operators.
+  private def adjustAdvisoryPartitionSizeInBytes(plan: SparkPlan, conf: SQLConf): Long = {
+    val postShuffleInputSize = conf.getConf(SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES)
+    val factor = 1.0 + plan.collect {
+      case e: ExpandExec => 0.5 * e.projections.size
+      case _ => 0

Review Comment:
   In our production environment, we support more operators:
   ```scala
   case _: BroadcastNestedLoopJoinExec => 4
   case SortMergeJoinExec(_, _, _, Some(condition), _, _, _) if containsInequalityPredicate(condition) => 3
   case ObjectHashAggregateExec(_, _, aggregateExpr, _, _, _, _)
     if aggregateExpr.exists {_.aggregateFunction match {
       case _: Percentile => true
       case _: ApproximatePercentile => true
       case _ => false
     }} => 2
   ```



-- 
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: reviews-unsubscribe@spark.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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