karenfeng opened a new pull request #31666:
URL: https://github.com/apache/spark/pull/31666


   ### What changes were proposed in this pull request?
   
   Adds the duplicated common columns as hidden columns to the Projection used 
to rewrite NATURAL/USING JOINs.
   Built off https://github.com/apache/spark/pull/31654.
   
   ### Why are the changes needed?
   
   Allows users to resolve either side of the NATURAL/USING JOIN's common keys.
   Previously, the user could only resolve the following columns:
   
   | Join type | Left key columns | Right key columns |
   | --- | --- | --- |
   | Inner | Yes | No |
   | Left | Yes | No |
   | Right | No | Yes |
   | Outer | No | No |
   
   This fix applies in SQL but does not apply in Scala; this seems to be 
related to the metadata column framework in the DSv2 API.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. The user can now symmetrically resolve the common columns from a 
NATURAL/USING JOIN.
   
   ### How was this patch tested?
   
   SQL-side tests. The behavior matches PostgreSQL and MySQL.


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

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