-
Notifications
You must be signed in to change notification settings - Fork 716
feat: Add full-featured Iceberg MERGE INTO conditional merges support and argument validation #3201
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
base: main
Are you sure you want to change the base?
feat: Add full-featured Iceberg MERGE INTO conditional merges support and argument validation #3201
Conversation
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Currently failing 1 Athena test:
Plan to fix on next commit. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Feature or Bugfix
Detail
MERGE INTO
operations in _write_iceberg.py/to_icebergmerge_on_clause
: CustomON
statement in theMERGE INTO ... USING ... ON [custom_expression]
to allow<
,<=
,>
and>=
operators. Until now, only column equality was allowed. Risk of having more than one match in target table is warned in stringdocs.merge_condition
: Added new accepted valueconditional_merge
merge_conditional_clauses
: List of dictionaries specifying custom conditional clauses for theMERGE INTO
statement.Each dictionary should have:
- 'when': One of ['MATCHED', 'NOT MATCHED', 'NOT MATCHED BY SOURCE']
- 'action': One of ['UPDATE', 'DELETE', 'INSERT']
- 'condition': (optional) Additional SQL condition for the clause
- 'columns': (optional) List of columns to update or insert
Used only when merge_condition is 'conditional_merge'.
merge_cols
,merge_on_clause
,merge_match_nulls
,merge_condition
,merge_conditional_clauses
,Relates
This is the first draft of the implementation, feel free to suggest any changes in the approach. I am open to suggestions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.