cloud-fan commented on a change in pull request #25121: [SPARK-28356][SQL] Do
not reduce the number of partitions for repartition in adaptive execution
URL: https://github.com/apache/spark/pull/25121#discussion_r303279294
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/ReduceNumShufflePartitionsSuite.scala
##########
@@ -574,22 +574,17 @@ class ReduceNumShufflePartitionsSuite extends
SparkFunSuite with BeforeAndAfterA
withSparkSession(test, 4, None)
}
- test("Union two datasets with different pre-shuffle partition number") {
+ test("Do not reduce the number of shuffle partition for repartition") {
val test: SparkSession => Unit = { spark: SparkSession =>
- val dataset1 = spark.range(3)
- val dataset2 = spark.range(3)
-
- val resultDf = dataset1.repartition(2, dataset1.col("id"))
- .union(dataset2.repartition(3, dataset2.col("id"))).toDF()
+ val ds = spark.range(3)
+ val resultDf = ds.repartition(2, ds.col("id")).toDF()
checkAnswer(resultDf,
- Seq((0), (0), (1), (1), (2), (2)).map(i => Row(i)))
+ Seq((0), (1), (2)).map(i => Row(i)))
Review comment:
this is just `Seq(0, 1, 2)`, right?
----------------------------------------------------------------
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]