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

    https://github.com/apache/spark/pull/22284#discussion_r214270194
  
    --- 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 --
    
    yes, I am adding a test to the `PlannerSuite` which ensures that plans are 
different instances. Thanks.


---

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

Reply via email to