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/04/20 05:27:48 UTC
[GitHub] [spark] cloud-fan commented on a change in pull request #28226: [SPARK-31452][SQL] Do not create partition spec for 0-size partitions in AQE
cloud-fan commented on a change in pull request #28226:
URL: https://github.com/apache/spark/pull/28226#discussion_r411102045
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeSkewedJoin.scala
##########
@@ -88,9 +88,11 @@ case class OptimizeSkewedJoin(conf: SQLConf) extends Rule[SparkPlan] {
private def targetSize(sizes: Seq[Long], medianSize: Long): Long = {
val advisorySize = conf.getConf(SQLConf.ADVISORY_PARTITION_SIZE_IN_BYTES)
val nonSkewSizes = sizes.filterNot(isSkewed(_, medianSize))
- // It's impossible that all the partitions are skewed, as we use median size to define skew.
- assert(nonSkewSizes.nonEmpty)
- math.max(advisorySize, nonSkewSizes.sum / nonSkewSizes.length)
+ if (nonSkewSizes.isEmpty) {
Review comment:
because we calculate the median size based on the original map stats, but the input partitions are coalesced. It's possible all partitions (after coalesce) are skewed.
----------------------------------------------------------------
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
---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org