Zouxxyy opened a new pull request, #7976:
URL: https://github.com/apache/paimon/pull/7976

   ### Purpose
   
   Route MERGE INTO assignment alignment through `PaimonOutputResolver`
   so MERGE / UPDATE / INSERT share one name-based, depth-aware alignment
   path with consistent merge-schema semantics.
   
   Behavior is controlled by `spark.paimon.write.merge-schema`:
   
   - Top-level alignment is by name. Unmentioned target columns are
     NULL-filled under explicit clauses (matches Spark INSERT FILL).
   - `INSERT *` / `UPDATE *` with a source column missing from the target
     throws when `merge-schema=false`; when `true`, source-extras are kept
     so `SchemaHelper` evolves the table at write time.
   - Nested struct alignment follows `MissingFieldBehavior`:
     - `FailMissing` (`merge-schema=false`): nested missing target /
       source-extra throws.
     - `NullForMissing` (`merge-schema=true`, INSERT and explicit UPDATE):
       missing nested fields NULL-fill, source-extras kept at any depth.
     - `PreserveTarget` (`merge-schema=true`, `UPDATE *` on a struct
       target): missing source subfields are substituted with
       `GetStructField(target, ordinal)` so unmentioned subfields keep
       their current value instead of being nulled.
   
   ### Tests
   
   New `MergeIntoAlignmentTest` (24 cases) covers basic `UPDATE *` /
   `INSERT *`, source-extra drop under strict star, top-level and nested
   merge-schema evolution, `PreserveTarget` semantics on nested struct
   `UPDATE *`, explicit assignments to nested fields, and null-fill for
   omitted columns.


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

Reply via email to