Skip to content

[SPARK-52428] Add DataFrame::merge_into() builder for MERGE INTO operations#37

Open
rafafrdz wants to merge 1 commit intoapache:masterfrom
rafafrdz:add-dataframe-merge-into
Open

[SPARK-52428] Add DataFrame::merge_into() builder for MERGE INTO operations#37
rafafrdz wants to merge 1 commit intoapache:masterfrom
rafafrdz:add-dataframe-merge-into

Conversation

@rafafrdz
Copy link
Copy Markdown

Summary

  • Add MergeIntoBuilder with chainable methods: when_matched_update(), when_matched_delete(), when_not_matched_insert()
  • Add DataFrame::merge_into(target_table, condition) returning the builder
  • execute() creates a temp view for the source DataFrame and generates MERGE INTO SQL
df.merge_into("target_table", "target.id = source.id")
    .when_matched_update("target.value = source.value")
    .when_not_matched_insert("*")
    .execute()
    .await?;

Test plan

  • cargo build passes
  • cargo clippy passes
  • cargo fmt -- --check passes
  • Integration test with Delta Lake table

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.

1 participant