mgaido91 commented on a change in pull request #23258:
[SPARK-23375][SQL][FOLLOWUP][TEST] Test Sort metrics while Sort is missing
URL: https://github.com/apache/spark/pull/23258#discussion_r244508010
##########
File path:
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
##########
@@ -194,10 +194,20 @@ 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)
+ // Project(nodeId = 2)
+ // LocalTableScan(nodeId = 3)
+ // Because of SPARK-25267, ConvertToLocalRelation is disabled in the test
cases of sql/core,
+ // so Project here is not collapsed into LocalTableScan.
+ val df = Seq(1, 3, 2).toDF("id").sort('id)
+ testSparkPlanMetrics(df, 2, Map(
Review comment:
I think we can get back to the previous idea of having another method for
testing a predicate. And use the patters there to validate it. I am not a fan
of introducing an enum for this.
----------------------------------------------------------------
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]