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