Skip to content

[SPARK-56472][SQL] Fix MERGE schema evolution with WHEN MATCHED THEN DELETE#55340

Closed
johanl-db wants to merge 2 commits into
apache:masterfrom
johanl-db:SPARK-56472-merge-schema-evolution-matched-delete
Closed

[SPARK-56472][SQL] Fix MERGE schema evolution with WHEN MATCHED THEN DELETE#55340
johanl-db wants to merge 2 commits into
apache:masterfrom
johanl-db:SPARK-56472-merge-schema-evolution-matched-delete

Conversation

@johanl-db
Copy link
Copy Markdown
Contributor

@johanl-db johanl-db commented Apr 14, 2026

What changes were proposed in this pull request?

Fixes a bug in MERGE INTO schema evolution so that MERGE statements that contain a DELETE clause correctly trigger schema evolution:

MERGE INTO target
USING source
ON target.id = source.id
WHEN MATCHED THEN DELETE
WHEN NOT MATCHED THEN INSERT SET *; 

Currently, schemaEvolutionReady always return false when there is a DELETE clause.

How was this patch tested?

Added a test, confirmed that the test fails without this fix.

@johanl-db johanl-db changed the title [SPARK-56472] Fix MERGE schema evolution with WHEN MATCHED THEN DELETE [SPARK-56472][SQL] Fix MERGE schema evolution with WHEN MATCHED THEN DELETE Apr 17, 2026
@johanl-db
Copy link
Copy Markdown
Contributor Author

@aokolnychyi / @cloud-fan this is ready to merge

Copy link
Copy Markdown
Contributor

@cloud-fan cloud-fan left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@cloud-fan
Copy link
Copy Markdown
Contributor

thanks, merging to master!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants