Github user kiszk commented on a diff in the pull request:
https://github.com/apache/spark/pull/22630#discussion_r223468018
--- Diff:
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
---
@@ -518,56 +521,81 @@ class SQLMetricsSuite extends SparkFunSuite with
SQLMetricsTestUtils with Shared
testMetricsDynamicPartition("parquet", "parquet", "t1")
}
+ private def collectNodeWithinWholeStage[T <: SparkPlan : ClassTag](plan:
SparkPlan): Seq[T] = {
+ val stages = plan.collect {
+ case w: WholeStageCodegenExec => w
+ }
+ assert(stages.length == 1, "The query plan should have one and only
one whole-stage.")
+ stages.head
--- End diff --
nit: Do we need this line?
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]