-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
quote_identifiers
parameter to unpivot
to handle case-sensiti…
…ve column names (#792) * feat(unpivot): add quote identifier parameter to unpivot macro fixes #216 * Changelog will be updated as part of release process * Enable test for unpivoting quoted columns for Redshift * Fix warning related to `tests:` -> `data_tests:` * Simplify the case-sensitive unpivot test model * Add a newline for consistency * Use mixed-case column names for all columns --------- Co-authored-by: Doug Beatty <[email protected]>
- Loading branch information
Showing
7 changed files
with
42 additions
and
8 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
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 @@ | ||
Customer_Id,Created_At,sTaTuS,SEGMENT,Name | ||
123,2017-01-01,active,tier 1,name 1 | ||
234,2017-02-01,active,tier 3,name 3 | ||
567,2017-03-01,churned,tier 2,name 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Customer_Id,Created_At,Prop,Val | ||
123,"2017-01-01","SEGMENT","tier 1" | ||
123,"2017-01-01","sTaTuS","active" | ||
234,"2017-02-01","SEGMENT","tier 3" | ||
234,"2017-02-01","sTaTuS","active" | ||
567,"2017-03-01","sTaTuS","churned" | ||
567,"2017-03-01","SEGMENT","tier 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
{{ dbt_utils.unpivot( | ||
relation=ref('data_unpivot_quote'), | ||
cast_to=type_string(), | ||
exclude=['Customer_Id', 'Created_At'], | ||
remove=['Name'], | ||
field_name='Prop', | ||
value_name='Val', | ||
quote_identifiers=True, | ||
) }} |
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