You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "johanl-db (via GitHub)" <gi...@apache.org> on 2026/04/14 06:33:02 UTC

Re: [PR] [SPARK-56054][SQL] Undo handling aliased assignments in MERGE INTO schema evolution and add tests [spark]

johanl-db commented on PR #55239:
URL: https://github.com/apache/spark/pull/55239#issuecomment-4241723533

   > @johanl-db, what about cases when the source query has an alias?
   > 
   > ```
   > MERGE INTO t
   > USING (SELECT 'blah' AS col1, 1 AS col2 FROM source) AS s
   > ON false
   > WHEN NOT MATCHED THEN INSERT *
   > ```
   
   Discussed directly with @aokolnychyi and @szehon-ho :
   The shape of source doesn't matter at all, the only parts that matter when performing schema evolution are:
   - The schema of the source
   - The assignment expressions in the match clauses
   
   MERGE doesn't look inside the source query to see what it contains, so the aliases there are irrelevant.
   This case will trigger schema evolution for all new columns in the source schema, since there's an INSERT * assignment.


-- 
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-unsubscribe@spark.apache.org

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


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