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 16:09:43 UTC
[GitHub] [spark] maryannxue commented on a change in pull request #28153:
[SPARK-31384][SQL] Fix NPE in OptimizeSkewedJoin
maryannxue commented on a change in pull request #28153: [SPARK-31384][SQL] Fix NPE in OptimizeSkewedJoin
URL: https://github.com/apache/spark/pull/28153#discussion_r406315418
##########
File path: sql/core/src/main/scala/org/apache/spark/sql/execution/adaptive/CustomShuffleReaderExec.scala
##########
@@ -99,12 +99,17 @@ case class CustomShuffleReaderExec private(
val maxSize = SQLMetrics.createSizeMetric(sparkContext, "maximum partition data size")
val minSize = SQLMetrics.createSizeMetric(sparkContext, "minimum partition data size")
val avgSize = SQLMetrics.createSizeMetric(sparkContext, "average partition data size")
- val mapStats = shuffleStage.get.mapStats.bytesByPartitionId
- val sizes = partitionSpecs.map {
- case CoalescedPartitionSpec(startReducerIndex, endReducerIndex) =>
- startReducerIndex.until(endReducerIndex).map(mapStats(_)).sum
- case p: PartialReducerPartitionSpec => p.dataSize
- case p => throw new IllegalStateException("unexpected " + p)
+ val mapStats = shuffleStage.get.mapStats
+ val sizes = if (mapStats.isDefined) {
Review comment:
nit: mapStats.map(...).getOrElse(Seq(0L)) ?
----------------------------------------------------------------
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