LukaZdravic commented on code in PR #60227:
URL: https://github.com/apache/spark/pull/60227#discussion_r4513361092


##########
sql/core/src/test/scala/org/apache/spark/sql/AsOfJoinSortMergeSQLSuite.scala:
##########
@@ -69,9 +70,54 @@ class AsOfJoinSortMergeSQLSuite extends QueryTest
   }
 
   private def checkSortMergeAsOf(query: => DataFrame, expected: Seq[Row]): 
Unit = {
-    val df = query
-    assertUsesSortMergeAsOfJoin(df)
-    checkAnswer(df, expected)
+    checkWithAsOfJoinCodegenOffAndOn(query) { df =>
+      assertUsesSortMergeAsOfJoin(df)
+      checkAnswer(df, expected)
+    }
+  }
+
+  /**
+   * Runs `check` on `query` with the ASOF join codegen off, then on, and 
asserts which ASOF
+   * joins ran generated. A DataFrame keeps the plan it got first, so the run 
with the codegen
+   * off checks a new DataFrame for the same query. The run with it on, the 
default, checks
+   * `query` itself, which the test may check again afterwards.
+   */
+  private def checkWithAsOfJoinCodegenOffAndOn(query: => DataFrame)(

Review Comment:
   Fixed, added `checkToRDD=false`!



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to