Github user maropu commented on a diff in the pull request:
https://github.com/apache/spark/pull/23258#discussion_r239993718
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
---
@@ -182,10 +182,13 @@ class SQLMetricsSuite extends SparkFunSuite with
SQLMetricsTestUtils with Shared
}
test("Sort metrics") {
- // Assume the execution plan is
- // WholeStageCodegen(nodeId = 0, Range(nodeId = 2) -> Sort(nodeId = 1))
- val ds = spark.range(10).sort('id)
- testSparkPlanMetrics(ds.toDF(), 2, Map.empty)
+ // Assume the execution plan with node id is
+ // Sort(nodeId = 0)
+ // Exchange(nodeId = 1)
+ // Range(nodeId = 2)
+ val df = spark.range(9, -1, -1).sort('id).toDF()
+ testSparkPlanMetrics(df, 2, Map.empty)
+
df.queryExecution.executedPlan.find(_.isInstanceOf[SortExec]).getOrElse(assert(false))
--- End diff --
`assert(df.queryExecution.executedPlan.find(_.isInstanceOf[SortExec]).isDefined)`?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]