srielau opened a new pull request, #57654:
URL: https://github.com/apache/spark/pull/57654

   ### What changes were proposed in this pull request?
   
   Add single-pass (Analyzer++) support for ASOF JOIN, reverse-cherry-picked 
from Databricks Runtime PRs 
[#241669](https://github.com/databricks-eng/runtime/pull/241669) 
(`JoinLikeResolver` extraction) and 
[#240412](https://github.com/databricks-eng/runtime/pull/240412) (ASOF JOIN 
resolver).
   
   - Extract shared join-child resolution, join-condition resolution, and 
hidden-output helpers into a new `JoinLikeResolver` trait used by 
`JoinResolver`.
   - Add `AsOfJoinResolver` that resolves SQL `MATCH_CONDITION` / `USING` ASOF 
joins and DataFrame-created ASOF joins in one pass.
   - Share MATCH_CONDITION materialization between the fixed-point 
`ResolveAsOfJoin` rule and the single-pass resolver via 
`AsOfJoinMatchConditionResolution`.
   - Wire ASOF JOIN into resolver routing, `ResolverGuard`, dual-run view 
confs, and `ResolutionValidator`.
   - Add `spark.sql.analyzer.singlePassResolver.enableAsOfJoinResolution` 
(default `true`).
   
   ### Why are the changes needed?
   
   ASOF JOIN is already available in Spark SQL / DataFrame APIs, but the 
single-pass analyzer still falls back to the fixed-point path for `AsOfJoin`. 
This closes that gap so ASOF JOIN plans can be resolved by Analyzer++ with plan 
parity under dual-run.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No intentional behavior change for queries that already work under the 
fixed-point analyzer. ASOF JOIN is now eligible for single-pass resolution when
   `spark.sql.analyzer.singlePassResolver.enableAsOfJoinResolution` is true 
(default).
   
   ### How was this patch tested?
   
   - `build/sbt 'catalyst/testOnly 
org.apache.spark.sql.catalyst.analysis.resolver.ResolutionValidatorSuite'`
   - `build/sbt 'sql/testOnly 
org.apache.spark.sql.analysis.resolver.ResolverGuardSuite -- -z "ASOF JOIN"'`
   - Existing ASOF JOIN SQL goldens / suites exercise dual-run plan parity when 
single-pass is enabled.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor Grok 4.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]

Reply via email to