-
Notifications
You must be signed in to change notification settings - Fork 510
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace references to tables to relations. Add include param to union (…
…#178) * Add include param to union. * Replace tables with relations * Clean up union tests
- Loading branch information
Claire Carroll
authored
Dec 11, 2019
1 parent
e2f5a71
commit 18ab2fb
Showing
8 changed files
with
132 additions
and
75 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
4 changes: 4 additions & 0 deletions
4
integration_tests/models/sql/test_get_relations_by_prefix_and_union.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,4 @@ | ||
{{ config(materialized = 'table') }} | ||
|
||
{% set relations = dbt_utils.get_relations_by_prefix(target.schema, 'data_events_') %} | ||
{{ dbt_utils.union_relations(relations) }} |
14 changes: 2 additions & 12 deletions
14
integration_tests/models/sql/test_get_tables_by_prefix_and_union.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 |
---|---|---|
@@ -1,14 +1,4 @@ | ||
{{config( materialized = 'table')}} | ||
|
||
|
||
{% if target.type == 'snowflake' %} | ||
|
||
{% set tables = dbt_utils.get_tables_by_prefix((target.schema | upper), 'data_events_') %} | ||
{{ dbt_utils.union_tables(tables) }} | ||
|
||
{% else %} | ||
|
||
{% set tables = dbt_utils.get_tables_by_prefix(target.schema, 'data_events_') %} | ||
{{ dbt_utils.union_tables(tables) }} | ||
|
||
{% endif %} | ||
{% set tables = dbt_utils.get_tables_by_prefix(target.schema, 'data_events_') %} | ||
{{ dbt_utils.union_tables(tables) }} |
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 |
---|---|---|
@@ -1,6 +1,5 @@ | ||
|
||
{{ dbt_utils.union_tables([ | ||
{{ dbt_utils.union_relations([ | ||
ref('data_union_table_1'), | ||
ref('data_union_table_2')] | ||
) }} | ||
|
||
) }} |
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
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