Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing merge clauses in DeltaTableWriter #44

Conversation

riccamini
Copy link
Contributor

Description

DeltaTableWriter provides the option to configure the writer in MERGE mode using the output_mode_params field by providing in it a list of merge clauses in the merge_builder key. This is especially useful in case the Delta table or the DataFrame to be merged are not available upfront. Not all merge clauses were supported: the merge clause provided was being validated against a list of valid clauses which did not include whenMatchedUpdateAll and whenNotMatchedInsertAll clauses. As part of this PR:

  • validation of the clauses now happens in the output_mode_params field validator (currently this is happening only when the merge is being executed)
  • the list of available merge clauses is sourced directly from available methods in DeltaMergeBuilder class and now includes all of them

Related Issue

#43

Motivation and Context

Now it's possible to use all merge clauses when configuring the DeltaTableWriter

How Has This Been Tested?

Tests covering validation errors have been added

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@riccamini riccamini requested a review from a team as a code owner June 7, 2024 17:02
Copy link
Member

@dannymeijer dannymeijer left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@dannymeijer dannymeijer self-requested a review June 10, 2024 11:01
dannymeijer
dannymeijer previously approved these changes Jun 10, 2024
@riccamini riccamini closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[FEATURE] Add missing merge clause types in DeltaTableWriter
2 participants