cloud-fan commented on code in PR #60227:
URL: https://github.com/apache/spark/pull/60227#discussion_r4527717346


##########
sql/core/src/test/scala/org/apache/spark/sql/SortMergeAsOfJoinSuite.scala:
##########
@@ -67,38 +71,95 @@ class SortMergeAsOfJoinSuite extends QueryTest
     (df1, df2)
   }
 
-  // Like checkAnswer, but also asserts the right-side buffer spilled 
(spillSize > 0).
-  private def checkAnswerAndSpill(df: classic.DataFrame, expectedAnswer: 
Seq[Row]): Unit = {
-    checkAnswer(df, expectedAnswer)
-    val op = collectFirst(df.queryExecution.executedPlan) {
-      case s: SortMergeAsOfJoinExec => s
+  // Like checkAnswer, but also asserts the right-side buffer spilled 
(spillSize > 0). Runs with
+  // the ASOF join codegen off and on, so both paths must handle the spilled 
buffer.

Review Comment:
   **Nit (P3):** This says both runs exercise a path that handles the spilled 
buffer, but three of the helper's eight callers pass `direction = "nearest"`: 
'nearest join applies eligibility on both sides after spilling' and both checks 
in 'nearest join - spill to disk'. `supportCodegen` is false for a nearest 
join, and `assertAsOfJoinCodegen` expects no codegen for one, so for those 
callers both runs use the interpreted scan. A reader can take the nearest spill 
tests as covering a generated spill path that does not exist. The sibling 
helper comments already add 'and the join is not nearest'; this one could say 
the same:
   
   ```suggestion
     // Like checkAnswer, but also asserts the right-side buffer spilled 
(spillSize > 0). Runs with
     // the ASOF join codegen off and on, so both paths must handle the spilled 
buffer, except for a
     // nearest join, which runs the interpreted scan both times.
   ```
   
   **Verification:**
   - **Inspection:** Reading the spill-check helper in the DataFrame ASOF join 
tests shows a comment that limits the two-path claim to backward and forward 
joins and says a nearest join runs the interpreted scan both times, with no 
executable line changed.



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