-
Notifications
You must be signed in to change notification settings - Fork 179
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
[ADAP-435] [Bug] Cannot use begin/end scripting statement with snowflake_dml_explicit_transaction #556
Comments
Thanks for reaching out @OSalamaPret ! Would you be interested in raising a PR with the fix you proposed? |
I tried, but not sure I'm able to sign the CLA on behalf of my company! I guess I could create a personal account and use that though. Will try it out when I get some free time. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
The suggested fix is here, namely: - begin;
+ begin transaction; I'm labeling this as a "good first issue" if anyone wants to pick it up. |
@dbeatty10 I'd be happy to pick this up. Will start going through the contributing guidelines! |
Any updates here? Issue is still persist and it is impossible to create procedure in snowflake from dbt. |
I'm closing this issue because at this time, we do not intend to support this use case in our roadmap. |
Is this a new bug in dbt-snowflake?
Current Behavior
I am writing a custom incremental materialization which calls
{{ strategy_sql_macro_func(strategy_arg_dict) }}
within a Snowflake scripting begin/end block.Example:
When this runs, it generates the following error
syntax error line 43 at position 7 unexpected ';'.
Expected Behavior
I expect that we should be able to mix Snowflake begin/end scripting blocks with transactions, as this is fully supported in Snowflake.
The issue is due to the
snowflake_dml_explicit_transaction
macro usingbegin
to start the transaction, which, in this context, Snowflake is seeing as a begin/end block.The fix is to use the explicit
begin transaction
instead ofbegin
I have overriden the
snowflake_dml_explicit_transaction
to usebegin transaction
and confirm that my issue is resolved.Steps To Reproduce
Quickest route to reproduce:
{%- call statement('main') -%}
to following:dbt run --select test_model.sql
Relevant log output
No response
Environment
Additional Context
BEGIN TRANSACTION
- https://docs.snowflake.com/en/sql-reference/transactions#explicit-transactionsThe text was updated successfully, but these errors were encountered: