cloud-fan commented on a change in pull request #26813: [SPARK-30188][SQL][WIP]
Enable adaptive query execution by default
URL: https://github.com/apache/spark/pull/26813#discussion_r362049957
##########
File path: sql/core/src/test/scala/org/apache/spark/sql/CachedTableSuite.scala
##########
@@ -466,152 +469,152 @@ class CachedTableSuite extends QueryTest with
SQLTestUtils with SharedSparkSessi
*/
private def verifyNumExchanges(df: DataFrame, expected: Int): Unit = {
assert(
- df.queryExecution.executedPlan.collect { case e: ShuffleExchangeExec =>
e }.size == expected)
+ collect(df.queryExecution.executedPlan) { case e: ShuffleExchangeExec =>
e }.size == expected)
}
test("A cached table preserves the partitioning and ordering of its cached
SparkPlan") {
- val table3x = testData.union(testData).union(testData)
- table3x.createOrReplaceTempView("testData3x")
-
- sql("SELECT key, value FROM testData3x ORDER BY
key").createOrReplaceTempView("orderedTable")
- spark.catalog.cacheTable("orderedTable")
- assertCached(spark.table("orderedTable"))
- // Should not have an exchange as the query is already sorted on the group
by key.
- verifyNumExchanges(sql("SELECT key, count(*) FROM orderedTable GROUP BY
key"), 0)
- checkAnswer(
- sql("SELECT key, count(*) FROM orderedTable GROUP BY key ORDER BY key"),
- sql("SELECT key, count(*) FROM testData3x GROUP BY key ORDER BY
key").collect())
- uncacheTable("orderedTable")
- spark.catalog.dropTempView("orderedTable")
-
- // Set up two tables distributed in the same way. Try this with the data
distributed into
- // different number of partitions.
- for (numPartitions <- 1 until 10 by 4) {
+ val table3x = testData.union(testData).union(testData)
Review comment:
wrong indentation
----------------------------------------------------------------
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]