vladimirg-db opened a new pull request, #50148:
URL: https://github.com/apache/spark/pull/50148

   ### What changes were proposed in this pull request?
   
   Strip away extra projection added by `DeduplicateRelations` when comparing 
logical plans.
   
   `DeduplicateRelations` puts one extra `Project` on the right branch of 
`Union` when the outputs of children are conflicting. This is a hack for 
streaming relations. Unfortunately this logic is generalized an the extra 
projection is used for simple cases like views:
   
   ```
   CREATE VIEW IF NOT EXISTS v1 AS SELECT * FROM VALUES (1, 2);
   
   SELECT * FROM (
     SELECT col1, col2 FROM v1
     UNION ALL
     SELECT col1, col2 FROM v1
   );
   ```
   
   Single-pass Analyzer doesn't produce this projection, because it assigns 
expression IDs in single-pass, so we strip it in `NormalizePlan` to correctly 
compare the plans.
   
   ### Why are the changes needed?
   
   This is to make sure that single-pass and fixed-point Analyzed plans are the 
same.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No.
   
   ### How was this patch tested?
   
   Existing tests.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   No.


-- 
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: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to