cloud-fan commented on a change in pull request #25479: [SPARK-28356][FOLLOWUP]
fix case with different pre-shuffle partition numbers
URL: https://github.com/apache/spark/pull/25479#discussion_r314777873
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/ReduceNumShufflePartitionsSuite.scala
##########
@@ -587,4 +587,22 @@ class ReduceNumShufflePartitionsSuite extends
SparkFunSuite with BeforeAndAfterA
}
withSparkSession(test, 200, None)
}
+
+ test("Union two datasets with different pre-shuffle partition number") {
+ val test: SparkSession => Unit = { spark: SparkSession =>
+ val df1 = spark.range(3).join(spark.range(3), "id").toDF()
+ val df2 = spark.range(3).groupBy().sum()
+
+ val resultDf = df1.union(df2)
+
+ checkAnswer(resultDf, Seq((0), (1), (2), (3)).map(i => Row(i)))
Review comment:
does this fail without the fix?
----------------------------------------------------------------
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]