squito commented on a change in pull request #28173: [SPARK-31389][SQL][TESTS] 
Ensure all tests in org.apache.spark.sql.execution.metric.SQLMetricsSuite run 
with both codegen on and off
URL: https://github.com/apache/spark/pull/28173#discussion_r406877479
 
 

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
 ##########
 @@ -268,6 +275,19 @@ class SQLMetricsSuite extends SharedSparkSession with 
SQLMetricsTestUtils {
           "remote blocks read" -> 0L,
           "shuffle records written" -> 2L))))
       )
+
+      val df1 = spark.sql(query)
+      testSparkPlanMetrics(df1, 1, Map(
+        1L -> (("SortMergeJoin", Map(
+          // It's 4 because we only read 3 rows in the first partition and 1 
row in the second one
+          "number of output rows" -> 4L))),
+        4L -> (("Exchange", Map(
+          "records read" -> 4L,
+          "local blocks read" -> 2L,
+          "remote blocks read" -> 0L,
+          "shuffle records written" -> 2L)))),
+        true
 
 Review comment:
   is this just a repeat of the above block of code with an extra `true` 
argument?  If so, better to refactor like
   
   ```scala
   Seq(true, false).foreach { wholeStageCodeGen =>
    testSparkPlanMetrics(..., wholeStageCodeGen)
   }
   ```
   
   same throughout all the changes.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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]

Reply via email to