-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from fishtown-analytics/fix/snowpipe-copy-commit
Commit transactions on Snowflake
- Loading branch information
Showing
5 changed files
with
29 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{% macro cleanup_external() %} | ||
{{ return(adapter.dispatch('cleanup_external', dbt_external_tables._get_dbt_external_tables_namespaces())()) }} | ||
{% endmacro %} | ||
|
||
{% macro default__cleanup_external() %} | ||
{% do log('No cleanup necessary, skipping', info = true) %} | ||
{# noop #} | ||
{% endmacro %} |
10 changes: 10 additions & 0 deletions
10
integration_tests/macros/plugins/snowflake/cleanup_external.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% macro snowflake__cleanup_external() %} | ||
|
||
{% set unset_autocommit %} | ||
alter user {{ target.user }} unset autocommit; | ||
{% endset %} | ||
|
||
{% do log('Unsetting autocommit parameter for user ' ~ target.user, info = true) %} | ||
{% do run_query(unset_autocommit) %} | ||
|
||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{% macro snowflake__exit_transaction() %} | ||
{{ return('begin; commit;') }} | ||
{% endmacro %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters