dongjoon-hyun opened a new pull request, #60536: URL: https://github.com/apache/spark/pull/60536
### What changes were proposed in this pull request? This PR makes the interpreted path of `SortMergeAsOfJoinExec.doExecute` read `left.output`, `right.output` and the join fields (`leftKeys`, `rightKeys`, `leftSortExprs`, `rightSortExprs`, `asOfCondition`, `joinType`, `condition`, `direction`) into local values before the `zipPartitions` closure, and passes those to `SortMergeAsOfJoinScanner`. SPARK-61666 removed the plan references from the generated path; this does the same for the interpreted path. ### Why are the changes needed? The closure read these fields from the node itself, so it captured `this`. Every task binary of the join then carried the `SortMergeAsOfJoinExec` node and its whole child subtree, down through the exchanges and their children. For example, the new test sees these plan nodes written with the RDD of a nearest join before this PR: ``` SortMergeAsOfJoin, WholeStageCodegen (1), Sort, InputAdapter, ShuffleQueryStage, Exchange, LocalTableScan, Exchange, LocalTableScan, WholeStageCodegen (2), Sort, InputAdapter, ShuffleQueryStage, Exchange, LocalTableScan, Exchange, LocalTableScan ``` The interpreted path runs for the `nearest` direction (it has no generated scan), when `spark.sql.codegen.wholeStage` is `false`, or when the join output has more fields than `spark.sql.codegen.maxFields`. ### Does this PR introduce _any_ user-facing change? No. The join returns the same rows; only the task binary gets smaller. ### How was this patch tested? Pass the CIs with the newly added test case, which serializes the RDD of an interpreted (nearest) as-of join, cutting the lineage at its input RDDs, and checks that no `SparkPlan` is written. It fails without this change. ``` $ build/sbt 'sql/testOnly org.apache.spark.sql.SortMergeAsOfJoinSuite -- -z "SPARK-61754"' ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 -- 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]
