Repository navigation
Destination Snowflake: add snowflake transaction wrapper for rollback support - #46989
Conversation
|
zeev-finaloop is attempting to deploy a commit to the Airbyte Growth Team on Vercel. A member of the Team first needs to authorize it. |
…ction-handling-fix
|
/bump-version type="patch" changelog="Adding Snowflake transaction wrapper"
|
|
Thank you for this! I kicked off the CI and bumped the version of the connector. This needs a proper review from @airbytehq/destinations team. |
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
Edward Gao (edgao)
left a comment
There was a problem hiding this comment.
does this work if instead of manually wrapping the sql, you replace the sql.asSqlStrings (line 249) call with this: (I'm probably getting the syntax wrong, but approximately something like it)
val transactions = sql.asSqlStrings(
"BEGIN; BEGIN TRANSACTION",
"""
COMMIT;
EXCEPTION
WHEN OTHER THEN
ROLLBACK;
BEGIN
RAISE;
END;
END;
""".trimIndent()
)
Edward Gao (@edgao) I think this may work with slight changes. I wanted to separate between transaction wrapping and snowflake script block wrapping. As I thought about it, |
|
yeah I think it would be preferable to use the same string-wrapper for both, to avoid future maintainers needing to notice the separate implementation (obviously if it makes things really messy for some reason, we can go with what you have though) |
change submitted, please trigger the pipeline |
Edward Gao (edgao)
left a comment
There was a problem hiding this comment.
M. Marx (@marcosmarxm) how do I trigger CI 😀
|
Done for you |
What
This PR is solving transaction rollback in Snowflake.
Currently in destination-snowflake we may have corrupt state of data in the destination due to incorrect assumptions on snowflake transaction management.
fixes #46936
How
We have added a dedicated transactionally method for snowflake that wraps the transaction in a script block, catches an exceptions and rolls back the changes.
Review guide
SnowflakeDestinationHandler.ktUser Impact
No visible impact
Can this PR be safely reverted and rolled back?