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/09 08:06:08 UTC

[GitHub] [spark] Ngone51 commented on a change in pull request #28153: [SPARK-31384][SQL] Fix NPE in OptimizeSkewedJoin

Ngone51 commented on a change in pull request #28153: [SPARK-31384][SQL] Fix NPE in OptimizeSkewedJoin
URL: https://github.com/apache/spark/pull/28153#discussion_r406027565
 
 

 ##########
 File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/QueryStageExec.scala
 ##########
 @@ -162,9 +162,11 @@ case class ShuffleQueryStageExec(
     }
   }
 
-  def mapStats: MapOutputStatistics = {
-    assert(resultOption.isDefined)
-    resultOption.get.asInstanceOf[MapOutputStatistics]
+  def mapStats: Option[MapOutputStatistics] = {
+    assert(resultOption.isDefined, "ShuffleQueryStageExec should already be ready")
+    val stats = resultOption.get.asInstanceOf[MapOutputStatistics]
+    // mapStats can be null when the input RDD of a plan has 0 partition
 
 Review comment:
   nit: `mapStats` -> `stats`

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