-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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-869: Support atomic replace in replace macro #8539
Changes from all commits
f0b07d0
24d9c42
7372440
d20f7dc
28e1612
4483f6c
03a15e7
d755c51
d898469
46e8aef
3572593
4404b85
e7909aa
71cc6ed
5dc4aea
38bbbdb
a6c5c0e
6dbaabb
aaec703
6159fd4
99a1bb4
17aae86
a31189e
24ebc37
a7db607
8b643bd
f513194
2f6cc57
9a9c163
37cbab8
30ab6b5
05c1e61
10f9c99
8e6930d
eaee53e
59e042c
0427da8
3f1bfcc
10d046d
94edba7
81098e8
922235b
de446b6
9d2b521
957a21d
882aac9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Support atomic replace in the global replace macro | ||
time: 2023-08-31T20:48:04.098933-04:00 | ||
custom: | ||
Author: mikealfare | ||
Issue: "8539" |
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Contents were moved to |
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaced with |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% macro get_replace_materialized_view_sql(relation, sql) %} | ||
{{- adapter.dispatch('get_replace_materialized_view_sql', 'dbt')(relation, sql) -}} | ||
{% endmacro %} | ||
|
||
|
||
{% macro default__get_replace_materialized_view_sql(relation, sql) %} | ||
{{ exceptions.raise_compiler_error( | ||
"`get_replace_materialized_view_sql` has not been implemented for this adapter." | ||
) }} | ||
{% endmacro %} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{% macro get_replace_table_sql(relation, sql) %} | ||
{{- adapter.dispatch('get_replace_table_sql', 'dbt')(relation, sql) -}} | ||
{% endmacro %} | ||
|
||
|
||
{% macro default__get_replace_table_sql(relation, sql) %} | ||
{{ exceptions.raise_compiler_error( | ||
"`get_replace_table_sql` has not been implemented for this adapter." | ||
) }} | ||
{% endmacro %} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Contents of this file were moved to |
This file was deleted.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Replaced with |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{% macro postgres__get_replace_table_sql(relation, sql) -%} | ||
|
||
{%- set sql_header = config.get('sql_header', none) -%} | ||
{{ sql_header if sql_header is not none }} | ||
|
||
create or replace table {{ relation }} | ||
{% set contract_config = config.get('contract') %} | ||
{% if contract_config.enforced %} | ||
{{ get_assert_columns_equivalent(sql) }} | ||
{{ get_table_columns_and_constraints() }} | ||
{%- set sql = get_select_subquery(sql) %} | ||
{% endif %} | ||
as ( | ||
{{ sql }} | ||
); | ||
|
||
{%- endmacro %} |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was taken from the default create view statement in |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{% macro postgres__get_replace_view_sql(relation, sql) -%} | ||
|
||
{%- set sql_header = config.get('sql_header', none) -%} | ||
{{ sql_header if sql_header is not none }} | ||
|
||
create or replace view {{ relation }} | ||
{% set contract_config = config.get('contract') %} | ||
{% if contract_config.enforced %} | ||
{{ get_assert_columns_equivalent(sql) }} | ||
{%- endif %} | ||
as ( | ||
{{ sql }} | ||
); | ||
|
||
{%- endmacro %} |
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.
Moved to
relations/materialized_view/alter.sql