gatorsmile commented on a change in pull request #23835:
[SPARK-24783][SQL]spark.sql.shuffle.partitions=0 should throw exception
URL: https://github.com/apache/spark/pull/23835#discussion_r258158056
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
##########
@@ -305,6 +305,26 @@ class SQLMetricsSuite extends SparkFunSuite with
SQLMetricsTestUtils with Shared
}
}
+ test("shuffle.partitions=0" ) {
+ withSQLConf("spark.sql.autoBroadcastJoinThreshold" -> "40",
+ "spark.sql.shuffle.partitions" -> "-1",
+ "spark.sql.join.preferSortMergeJoin" -> "false") {
+ val df1 = Seq((1, "1"), (2, "2")).toDF("key", "value")
+ val df2 = (1 to 10).map(i => (i, i.toString)).toSeq.toDF("key", "value")
+ // Assume the execution plan is
+ // Project(nodeId = 0)
+ // +- ShuffledHashJoin(nodeId = 1)
+ // :- Exchange(nodeId = 2)
+ // : +- Project(nodeId = 3)
+ // : +- LocalTableScan(nodeId = 4)
+ // +- Exchange(nodeId = 5)
+ // +- Project(nodeId = 6)
+ // +- LocalTableScan(nodeId = 7)
+ val df = df1.join(df2, "key")
+ assert(df.collect().size == 2)
Review comment:
call `checkAnswer`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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]