peter-toth opened a new pull request, #52835:
URL: https://github.com/apache/spark/pull/52835

   ### What changes were proposed in this pull request?
   
   This PR extracts the plan merging logic from `MergeScalarSubqueries` to 
`PlanMerger` so as to other rules can reuse it.
   
   While the plan merging logic is extracted without modification to 
`PlanMerger`, `MergeScalarSubqueries` required a significant adjustment. This 
is because [SPARK-40618](https://issues.apache.org/jira/browse/SPARK-40618) / 
https://github.com/apache/spark/pull/38093 added subquery reference tracking so 
as to avoid trying to merge a subquery to any of its nested subqueries. This 
kind of reference trancking doesn't work well with a general `PlanMerger` so 
this PR modifies `MergeScalarSubqueries` to use a separate `PlanMerger`s by 
each subquery level.
   
   ### Why are the changes needed?
   
   To be able to reuse plan merging logic.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing UTs.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Yes, Claude gave me suggestions to improve documentation.
   


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