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

 ##########
 File path: 
sql/core/src/test/scala/org/apache/spark/sql/execution/metric/SQLMetricsSuite.scala
 ##########
 @@ -279,21 +285,21 @@ class SQLMetricsSuite extends SharedSparkSession with 
SQLMetricsTestUtils {
     withTempView("testDataForJoin") {
       // Assume the execution plan is
       // ... -> SortMergeJoin(nodeId = 1) -> TungstenProject(nodeId = 0)
-      val df = spark.sql(
-        "SELECT * FROM testData2 left JOIN testDataForJoin ON testData2.a = 
testDataForJoin.a")
-      testSparkPlanMetrics(df, 1, Map(
-        0L -> (("SortMergeJoin", Map(
-          // It's 8 because we read 6 rows in the left and 2 row in the right 
one
-          "number of output rows" -> 8L))))
-      )
-
-      val df2 = spark.sql(
-        "SELECT * FROM testDataForJoin right JOIN testData2 ON testData2.a = 
testDataForJoin.a")
-      testSparkPlanMetrics(df2, 1, Map(
-        0L -> (("SortMergeJoin", Map(
-          // It's 8 because we read 6 rows in the left and 2 row in the right 
one
-          "number of output rows" -> 8L))))
-      )
+      val leftJoinQuery = "SELECT * FROM testData2 left JOIN testDataForJoin 
ON " +
+        "testData2.a = testDataForJoin.a"
+      val rightJoinQuery = "SELECT * FROM testDataForJoin right JOIN testData2 
ON " +
+        "testData2.a = testDataForJoin.a"
+
+      Seq((leftJoinQuery, false), (leftJoinQuery, true), (rightJoinQuery, 
false),
+        (rightJoinQuery, true)).foreach { args => {
 
 Review comment:
   nit: I think you don't need `{` in the end.

----------------------------------------------------------------
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