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 2019/12/12 13:33:50 UTC

[GitHub] [spark] srowen commented on a change in pull request #26862: [SPARK-30232] [SQL]fix the ArthmeticException by zero when enable AQE

srowen commented on a change in pull request #26862: [SPARK-30232] [SQL]fix the ArthmeticException by zero when enable AQE
URL: https://github.com/apache/spark/pull/26862#discussion_r357146326
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/OptimizeLocalShuffleReader.scala
 ##########
 @@ -88,7 +88,7 @@ case class OptimizeLocalShuffleReader(conf: SQLConf) extends Rule[SparkPlan] {
     }
     val numReducers = shuffleDep.partitioner.numPartitions
     val expectedParallelism = advisoryParallelism.getOrElse(numReducers)
-    val numMappers = shuffleDep.rdd.getNumPartitions
+    val numMappers = math.max(1, shuffleDep.rdd.getNumPartitions)
 
 Review comment:
   Hm, but if numMappers = 0, Array.fill never evaluates anything; you get an empty array. Are you sure this is the cause?

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