-
Notifications
You must be signed in to change notification settings - Fork 42
NOTICKET (feat): Add performance optimization for snowflake external tables #339
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
base: main
Are you sure you want to change the base?
Changes from all commits
5a0104a
e8c3009
7d2565b
f238253
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -54,6 +54,8 @@ | |||||||||||||||||
| {# Setting the column name for load date timestamp and record source to the alias coming from the attributes #} | ||||||||||||||||||
| {%- set ldts_alias = var('datavault4dbt.ldts_alias', 'ldts') -%} | ||||||||||||||||||
| {%- set rsrc_alias = var('datavault4dbt.rsrc_alias', 'rsrc') -%} | ||||||||||||||||||
| {%- set max_days_for_late_arriving_data = var('datavault4dbt.max_days_for_late_arriving_data', 'rsrc') -%} | ||||||||||||||||||
|
Collaborator
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. Default value is set as |
||||||||||||||||||
|
|
||||||||||||||||||
| {%- set copy_input_columns = var('datavault4dbt.copy_rsrc_ldts_input_columns', false) -%} | ||||||||||||||||||
| {%- set load_datetime_col_name = ldts_alias -%} | ||||||||||||||||||
| {%- set record_source_col_name = rsrc_alias -%} | ||||||||||||||||||
|
|
@@ -201,9 +203,14 @@ source_data AS ( | |||||||||||||||||
| {{- "\n\n " ~ datavault4dbt.print_list(datavault4dbt.escape_column_names(all_source_columns)) if all_source_columns else " *" }} | ||||||||||||||||||
|
|
||||||||||||||||||
| FROM {{ source_relation }} | ||||||||||||||||||
| WHERE 1 = 1 | ||||||||||||||||||
| {% if max_days_for_late_arriving_data|int != 0 %} | ||||||||||||||||||
|
|
||||||||||||||||||
| AND {{ ldts }} >= DATEADD(day, {{ max_days_for_late_arriving_data }}*-1, CURRENT_DATE) | ||||||||||||||||||
| {%- endif -%} | ||||||||||||||||||
|
Comment on lines
+207
to
+210
Collaborator
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.
Suggested change
Small readability adjustment |
||||||||||||||||||
|
|
||||||||||||||||||
| {% if is_incremental() %} | ||||||||||||||||||
| WHERE {{ ldts }} > (SELECT max({{ load_datetime_col_name}}) | ||||||||||||||||||
| AND {{ ldts }} > (SELECT max({{ load_datetime_col_name}}) | ||||||||||||||||||
| FROM {{ this }} | ||||||||||||||||||
| WHERE {{ load_datetime_col_name}} != {{ datavault4dbt.string_to_timestamp(timestamp_format , end_of_all_times) }} ) | ||||||||||||||||||
| {%- endif -%} | ||||||||||||||||||
|
|
||||||||||||||||||
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.
Same as above, the default should be set in a way that does not change existing behaviour