-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
171 additions
and
1 deletion.
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,4 @@ | ||
country_code,country_name | ||
US,United States | ||
CA,Canada | ||
GB,United Kingdom |
10 changes: 10 additions & 0 deletions
10
test/integration/065_postgres_index_tests/models-invalid/invalid_columns_type.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 @@ | ||
{{ | ||
config( | ||
materialized = "table", | ||
indexes=[ | ||
{'columns': 'column_a, column_b'}, | ||
] | ||
) | ||
}} | ||
|
||
select 1 as column_a, 2 as column_b |
10 changes: 10 additions & 0 deletions
10
test/integration/065_postgres_index_tests/models-invalid/invalid_type.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 @@ | ||
{{ | ||
config( | ||
materialized = "table", | ||
indexes=[ | ||
{'columns': ['column_a'], 'type': 'non_existent_type'}, | ||
] | ||
) | ||
}} | ||
|
||
select 1 as column_a, 2 as column_b |
10 changes: 10 additions & 0 deletions
10
test/integration/065_postgres_index_tests/models-invalid/invalid_unique_config.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 @@ | ||
{{ | ||
config( | ||
materialized = "table", | ||
indexes=[ | ||
{'columns': ['column_a'], 'unique': 'yes'}, | ||
] | ||
) | ||
}} | ||
|
||
select 1 as column_a, 2 as column_b |
10 changes: 10 additions & 0 deletions
10
test/integration/065_postgres_index_tests/models-invalid/missing_columns.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 @@ | ||
{{ | ||
config( | ||
materialized = "table", | ||
indexes=[ | ||
{'unique': True}, | ||
] | ||
) | ||
}} | ||
|
||
select 1 as column_a, 2 as column_b |
18 changes: 18 additions & 0 deletions
18
test/integration/065_postgres_index_tests/models/incremental.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,18 @@ | ||
{{ | ||
config( | ||
materialized = "incremental", | ||
indexes=[ | ||
{'columns': ['column_a'], 'type': 'hash'}, | ||
{'columns': ['column_a', 'column_b'], 'unique': True}, | ||
] | ||
) | ||
}} | ||
|
||
select * | ||
from ( | ||
select 1 as column_a, 2 as column_b | ||
) t | ||
|
||
{% if is_incremental() %} | ||
where column_a > (select max(column_a) from {{this}}) | ||
{% endif %} |
29 changes: 29 additions & 0 deletions
29
test/integration/065_postgres_index_tests/snapshots/colors.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,29 @@ | ||
{% snapshot colors %} | ||
|
||
{{ | ||
config( | ||
target_database=database, | ||
target_schema=schema, | ||
unique_key='id', | ||
strategy='check', | ||
check_cols=['color'], | ||
indexes=[ | ||
{'columns': ['id'], 'type': 'hash'}, | ||
{'columns': ['id', 'color'], 'unique': True}, | ||
] | ||
) | ||
}} | ||
|
||
{% if var('version') == 1 %} | ||
|
||
select 1 as id, 'red' as color union all | ||
select 2 as id, 'green' as color | ||
|
||
{% else %} | ||
|
||
select 1 as id, 'blue' as color union all | ||
select 2 as id, 'green' as color | ||
|
||
{% endif %} | ||
|
||
{% endsnapshot %} |
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