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

Support idempotent write using SQL options for INSERTS/DELETE/UPDATE/MERGE #1555

Closed
wants to merge 1 commit into from

Conversation

zedtang
Copy link
Collaborator

@zedtang zedtang commented Jan 11, 2023

Description

Currently, delta supports idempotent write using Dataframe writer options. These writer options are applicable to inserts only. This PR adds support for idempotency using SQL options(DELTA_IDEMPOTENT_DML_TXN_APP_ID and DELTA_IDEMPOTENT_DML_TXN_VERSION) to INSERTS/DELETE/UPDATE/MERGE etc. When both writer options and SQL conf are specified, we will use the writer option values.

Idempotent write works by checking the txnVersion and txnAppId from user-provided write options or from session configurations(as a SQL conf). If the same or higher txnVersion has been recorded, then it will skip the write.

How was this patch tested?

Add unit tests to test out the idempotency.

Does this PR introduce any user-facing changes?

No

…MERGE

Currently, delta supports idempotent write using Dataframe writer options. These writer options are applicable to inserts only. This PR adds support for idempotency using SQL options(DELTA_IDEMPOTENT_DML_TXN_APP_ID and DELTA_IDEMPOTENT_DML_TXN_VERSION) to INSERTS/DELETE/UPDATE/MERGE etc. When both writer options and SQL conf are specified, we will use the writer option values.

Idempotent write works by checking the txnVersion and txnAppId from user-provided write options or from session configurations(as a SQL conf). If the same or higher txnVersion has been recorded, then it will skip the write.

Add unit tests to test out the idempotency.
@vkorukanti vkorukanti closed this Jan 13, 2023
vkorukanti pushed a commit to vkorukanti/delta that referenced this pull request Jan 20, 2023
…MERGE

Currently, delta supports idempotent write using Dataframe writer options. These writer options are applicable to inserts only. This PR adds support for idempotency using SQL options(`DELTA_IDEMPOTENT_DML_TXN_APP_ID` and `DELTA_IDEMPOTENT_DML_TXN_VERSION`) to INSERTS/DELETE/UPDATE/MERGE etc. When both writer options and SQL conf are specified, we will use the writer option values.

Idempotent write works by checking the txnVersion and txnAppId from user-provided write options or from session configurations(as a SQL conf). If the same or higher txnVersion has been recorded, then it will skip the write.

Add unit tests to test out the idempotency.

Closes delta-io#1555

GitOrigin-RevId: 842e56508137c5913e42bc32267ac74e6f2643ce
@vkorukanti vkorukanti reopened this Jan 24, 2023
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.

None yet

2 participants