-
Notifications
You must be signed in to change notification settings - Fork 418
Enable merge write disposition for athena Iceberg
#1315
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
Enable merge write disposition for athena Iceberg
#1315
Conversation
✅ Deploy Preview for dlt-hub-docs ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
delete-insert merge strategy for athena Icebergmerge write disposition for athena Iceberg
| condition_columns, | ||
| ) | ||
| # DROP needs backtick as escape identifier | ||
| sql.insert(0, f"""DROP TABLE IF EXISTS {temp_table_name.replace('"', '`')};""") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, and there's PR (#998 ) that allows to escape for DDL and DML separately
rudolfix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
| The `merge` write disposition is supported for Athena when using iceberg tables. | ||
|
|
||
| > Note that: | ||
| > 1. there is a risk of tables ending up in inconsistent state in case a pipeline run fails mid flight, because Athena doesn't support transactions, and `dlt` uses multiple DELETE/UPDATE/INSERT statements to implement `merge`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not use the merge syntax that is available in Athena?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Full discussion is here: #1294.
TLDR: we're planning to add a new merge strategy based on the MERGE statement, but this isn't properly specced yet. We want consistent behavior accross different destinations, hence the implementation of delete-insert for athena now. MERGE-based merge for athena will come together with the other destinations.
Description
This PR enables the
mergewrite disposition (bothdelete-insertandscd2strategies) for theathenadestination withicebergtable format.for
delete-insert:Related Issues
Additional Context
Discussion on how we end up using this approach on this PR: #1294