szehon-ho opened a new pull request, #56710:
URL: https://github.com/apache/spark/pull/56710

   ### What changes were proposed in this pull request?
   
   This PR documents `MERGE WITH SCHEMA EVOLUTION` in the MERGE INTO SQL 
reference (`docs/sql-ref-syntax-dml-merge-into.md`), mirroring the existing 
INSERT INTO schema evolution documentation. Specifically it:
   
   - Adds `[ WITH SCHEMA EVOLUTION ]` to the **Syntax** and a `WITH SCHEMA 
EVOLUTION` entry to the **Parameters**.
   - Adds notes describing what triggers schema evolution: only columns 
referenced by a direct assignment are added/widened; `UPDATE SET *` / `INSERT 
*` count as direct assignments of every target column; and directly assigning a 
struct column counts as a direct assignment of every nested field.
   - Adds a `Schema Evolution` examples subsection (add a top-level column, add 
a nested struct field, widen a column's type).
   - Adds a `Schema Evolution Triggers` examples subsection (an extra column 
used only in an expression is not added; a wider value produced by an 
expression is not widened and overflows; directly assigning a struct adds its 
new nested fields).
   - Adds a `Schema Evolution When the Source Omits Columns` examples 
subsection.
   
   The examples and behavior were cross-checked against the 
`MergeIntoSchemaEvolution*` test suites under `sql/core`.
   
   ### Why are the changes needed?
   
   `MERGE WITH SCHEMA EVOLUTION` is supported but undocumented in the SQL 
reference, while the analogous `INSERT WITH SCHEMA EVOLUTION` is documented. 
This brings the MERGE INTO reference to parity.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No (documentation-only change).
   
   ### How was this patch tested?
   
   Documentation-only change. The example behavior was verified against the 
existing `MergeIntoSchemaEvolution*` test suites.
   
   ### Was this patch authored or co-authored using generative AI tooling?
   
   Generated-by: Cursor (Claude Opus 4.8)


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