-
Notifications
You must be signed in to change notification settings - Fork 178
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
Add refresh_mode
and initialize
as dynamic table options
#1081
Changes from all commits
7ba40c9
17eb974
c92522e
addaa63
932a58f
13dc7de
6076e3a
1c2f222
c2905cc
f44ebf6
761a991
c2bf2b3
08ddd42
405420f
8606770
c7781a4
99ba501
3db741b
657d498
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 refresh_mode and initialize parameters for dynamic tables | ||
time: 2024-01-31T12:53:18.111616Z | ||
custom: | ||
Author: HenkvanDyk,mikealfare | ||
Issue: "1076" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,18 @@ | ||
{% macro snowflake__get_replace_dynamic_table_sql(relation, sql) %} | ||
{% macro snowflake__get_replace_dynamic_table_sql(relation, sql) -%} | ||
|
||
{%- set dynamic_table = relation.from_config(config.model) -%} | ||
|
||
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. Same comment as for |
||
create or replace dynamic table {{ relation }} | ||
target_lag = '{{ config.get("target_lag") }}' | ||
warehouse = {{ config.get("snowflake_warehouse") }} | ||
target_lag = '{{ dynamic_table.target_lag }}' | ||
warehouse = {{ dynamic_table.snowflake_warehouse }} | ||
{% if dynamic_table.refresh_mode %} | ||
refresh_mode = {{ dynamic_table.refresh_mode }} | ||
{% endif %} | ||
{% if dynamic_table.initialize %} | ||
initialize = {{ dynamic_table.initialize }} | ||
{% endif %} | ||
as ( | ||
{{ sql }} | ||
) | ||
; | ||
{{ snowflake__refresh_dynamic_table(relation) }} | ||
|
||
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 is now handled via the |
||
{% endmacro %} | ||
{%- 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.
Using the
RelationConfig
allows us to easily incorporate input validation forrefresh_mode
andinitialize
. If we're doing that, we should pull all attribution from this class, hence updatingtarget_lag
andsnowflake_warehouse
.