Skip to content

Commit

Permalink
Merge pull request #64 from Kyligence/fix_aee
Browse files Browse the repository at this point in the history
#62 [SPARK-29284][SQL] Adaptive query execution works correctly when …
  • Loading branch information
7mming7 authored Oct 12, 2019
2 parents 9e90f39 + b9ae9bc commit 9943b01
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ class ExchangeCoordinator(
// number of post-shuffle partitions.
val partitionStartIndices =
if (mapOutputStatistics.length == 0) {
Array.empty[Int]
Array(0)
} else {
estimatePartitionStartIndices(mapOutputStatistics)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -527,4 +527,15 @@ class ExchangeCoordinatorSuite extends SparkFunSuite with BeforeAndAfterAll {
}
withSparkSession(test, 4, None)
}

test("SPARK-29284 adaptive query execution works correctly " +
"when first stage partitions size is 0") {
val test = { spark: SparkSession =>
spark.sql("SET spark.sql.adaptive.enabled=true")
spark.sql("SET spark.sql.shuffle.partitions=1")
val resultDf = spark.range(0).distinct().groupBy().count()
checkAnswer(resultDf, Row(0) :: Nil)
}
withSparkSession(test, 4, None)
}
}

0 comments on commit 9943b01

Please sign in to comment.