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:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]