-
Notifications
You must be signed in to change notification settings - Fork 79
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
5 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
integration-tests/models/model_refers_different_column_cases.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,8 @@ | ||
select | ||
"UPPER_CASE_COLUMN", | ||
"Mixed Case Column", | ||
"lowercasecolumn", | ||
UPPER_CASE_COLUMN, | ||
MixedCaseColumn, | ||
lower_case_column | ||
from {{ dbt_unit_testing.ref('model_with_different_column_cases') }} |
7 changes: 7 additions & 0 deletions
7
integration-tests/models/model_with_different_column_cases.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,7 @@ | ||
select | ||
1 as "UPPER_CASE_COLUMN", | ||
2 as "Mixed Case Column", | ||
3 as "lowercasecolumn", | ||
4 as UPPER_CASE_COLUMN, | ||
5 as MixedCaseColumn, | ||
6 as lower_case_column |
43 changes: 43 additions & 0 deletions
43
integration-tests/tests/unit/model_refers_different_column_cases.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,43 @@ | ||
{{ | ||
config( | ||
tags=['unit-test', 'bigquery', 'snowflake', 'postgres'] | ||
) | ||
}} | ||
|
||
{% call dbt_unit_testing.test('model_refers_different_column_cases') %} | ||
{% call dbt_unit_testing.mock_ref ('model_with_different_column_cases') %} | ||
select | ||
1 as "UPPER_CASE_COLUMN", | ||
2 as "Mixed Case Column", | ||
3 as "lowercasecolumn", | ||
4 as UPPER_CASE_COLUMN, | ||
5 as MixedCaseColumn, | ||
6 as lower_case_column | ||
{% endcall %} | ||
{% call dbt_unit_testing.expect() %} | ||
select | ||
1 as "UPPER_CASE_COLUMN", | ||
2 as "Mixed Case Column", | ||
3 as "lowercasecolumn", | ||
4 as UPPER_CASE_COLUMN, | ||
5 as MixedCaseColumn, | ||
6 as lower_case_column | ||
{% endcall %} | ||
{% endcall %} | ||
|
||
UNION ALL | ||
|
||
{% call dbt_unit_testing.test('model_refers_different_column_cases') %} | ||
{% call dbt_unit_testing.mock_ref ('model_with_different_column_cases', options={"include_missing_columns": true}) %} | ||
select 0 as c | ||
{% endcall %} | ||
{% call dbt_unit_testing.expect() %} | ||
select | ||
CAST(null AS Int) as "UPPER_CASE_COLUMN", | ||
CAST(null AS Int) as "Mixed Case Column", | ||
CAST(null AS Int) as "lowercasecolumn", | ||
CAST(null AS Int) as UPPER_CASE_COLUMN, | ||
CAST(null AS Int) as MixedCaseColumn, | ||
CAST(null AS Int) as lower_case_column | ||
{% endcall %} | ||
{% endcall %} |
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