Github user maropu commented on a diff in the pull request:

    https://github.com/apache/spark/pull/22284#discussion_r214227657
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
 ---
    @@ -497,6 +497,17 @@ class SQLMetricsSuite extends SparkFunSuite with 
SQLMetricsTestUtils with Shared
         }
       }
     
    +  test("SPARK-25278: output metrics are wrong for plans repeated in the 
query") {
    +    val name = "demo_view"
    +    sql(s"CREATE OR REPLACE VIEW $name AS VALUES 1,2")
    +    val view = spark.table(name)
    +    val union = view.union(view)
    +    testSparkPlanMetrics(union, 1, Map(
    +      0L -> ("Union" -> Map()),
    +      1L -> ("LocalTableScan" -> Map("number of output rows" -> 2L)),
    +      2L -> ("LocalTableScan" -> Map("number of output rows" -> 2L))))
    +  }
    +
    --- End diff --
    
    In addition to this end-to-end test, can we add fine-grained tests for the 
scenario you described in the PR description?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to