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

   ### What changes were proposed in this pull request?
   
   Followup of #55629, addressing the review comment at 
https://github.com/apache/spark/pull/55629#discussion_r3185614384.
   
   Adds a dedicated `CheckAnalysis` case that fails with 
`NEAREST_BY_JOIN.CROSS_JOIN_NOT_ENABLED` when a nearest-by join is attempted 
while `spark.sql.crossJoin.enabled = false`. Previously the query fell through 
to the generic cross-join check and produced a confusing, unrelated error.
   
   ### Why are the changes needed?
   
   The nearest-by join is internally implemented as a bounded cross-product. 
Without this guard a user gets the misleading `_LEGACY_ERROR_TEMP_1211` 
cross-join error rather than a clear message explaining the relationship to 
`spark.sql.crossJoin.enabled`.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. Users who run a nearest-by join with `spark.sql.crossJoin.enabled = 
false` now receive the structured error 
`NEAREST_BY_JOIN.CROSS_JOIN_NOT_ENABLED` with an actionable message instead of 
a generic cross-join error.
   
   ### How was this patch tested?
   
   - New unit test in `AnalysisErrorSuite` (`NearestByJoin is rejected when 
spark.sql.crossJoin.enabled is false`)
   - Updated SQL golden files (`join-nearest-by.sql.out`) regenerated to 
reflect the new error
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Claude Code (claude-sonnet-4-6)


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