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/13 02:37:50 UTC

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

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

 ##########
 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:
   yes, we may does not need this check. The error is tested with previous commit and it seems fixed in the latest commit. And I will close this PR. Thanks

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