Skip to content

Conversation

@szehon-ho
Copy link
Member

@szehon-ho szehon-ho commented Nov 24, 2025

What changes were proposed in this pull request?

Follow up of: #53149

Make the update assignment by field the Spark 4.1 behavior. For context, the case to allow assignment key and value to be different struct for MERGE INTO is new in Spark 4.1 so we have a chance to define the behavior. In Spark, nested fields are usually treated as top level column so it should follow the behavior: see #53149 (comment)

Why are the changes needed?

See above

Does this PR introduce any user-facing change?

No, this feature is unreleased (allowing assignment source to be of different struct type as target)

How was this patch tested?

Existing unit test

Was this patch authored or co-authored using generative AI tooling?

No

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.
Merged to master/4.1.

dongjoon-hyun pushed a commit that referenced this pull request Nov 24, 2025
…eld default for UPDATE SET * and align configs

### What changes were proposed in this pull request?
Follow up of: #53149

1. Make the update assignment by field the Spark 4.1 behavior.  For context, the case to allow assignment key and value to be different struct for MERGE INTO is new in Spark 4.1 so we have a chance to define the behavior.  In Spark, nested fields are usually treated as top level column so it should follow the behavior: see #53149 (comment)
2. Rename existing config to control the struct type compatibility check in assignment.  We do not need to mention 'source' as actually the assignment can be to anything, not necessarily to source table.

### Why are the changes needed?
See above

### Does this PR introduce _any_ user-facing change?
No, this feature is unreleased (allowing assignment source to be of different struct type as target)

### How was this patch tested?
Existing unit test

### Was this patch authored or co-authored using generative AI tooling?
No

Closes #53199 from szehon-ho/merge_schema_evolution_update_nested_follow.

Authored-by: Szehon Ho <szehon.apache@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
(cherry picked from commit 9846dd8)
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
@dongjoon-hyun
Copy link
Member

Thank you, @szehon-ho .

@cloud-fan
Copy link
Contributor

late LGTM

@dongjoon-hyun
Copy link
Member

Thank you, @cloud-fan .

huangxiaopingRD pushed a commit to huangxiaopingRD/spark that referenced this pull request Nov 25, 2025
…eld default for UPDATE SET * and align configs

### What changes were proposed in this pull request?
Follow up of: apache#53149

1. Make the update assignment by field the Spark 4.1 behavior.  For context, the case to allow assignment key and value to be different struct for MERGE INTO is new in Spark 4.1 so we have a chance to define the behavior.  In Spark, nested fields are usually treated as top level column so it should follow the behavior: see apache#53149 (comment)
2. Rename existing config to control the struct type compatibility check in assignment.  We do not need to mention 'source' as actually the assignment can be to anything, not necessarily to source table.

### Why are the changes needed?
See above

### Does this PR introduce _any_ user-facing change?
No, this feature is unreleased (allowing assignment source to be of different struct type as target)

### How was this patch tested?
Existing unit test

### Was this patch authored or co-authored using generative AI tooling?
No

Closes apache#53199 from szehon-ho/merge_schema_evolution_update_nested_follow.

Authored-by: Szehon Ho <szehon.apache@gmail.com>
Signed-off-by: Dongjoon Hyun <dongjoon@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants