-
Notifications
You must be signed in to change notification settings - Fork 112
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
Added case_sensitive_cols argument to generate_base_model macro #63
Conversation
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.
LGTM!
Just a quick comment about describing what the new parameter actually does
Oh, and I didn't see that it fails for Redshift. Not sure why this is the case though. |
I'm guessing it's this - https://docs.aws.amazon.com/redshift/latest/dg/r_enable_case_sensitive_identifier.html |
Column names in Google BigQuery are not able to be case sensitive... I updated the logic to remove the "" wrapping that was throwing an error for BigQuery only. So the
Example in other data warehouse:
|
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.
It would be awesome if there's some property of the adapter itself that we can use for handling columns that should/shouldn't be quoted. That would enable us to just apply whatever that logic is rather than requiring logic like if target.type == "bigquery"
.
Here's some examples of the kind of thing I'm thinking of:
- https://docs.getdbt.com/reference/resource-properties/quote
- https://docs.getdbt.com/reference/project-configs/quoting
- https://docs.getdbt.com/reference/resource-configs/quote_columns
Since this is working and for sake of expediency, I didn't research if any of these (or alternatives) would be applicable to this case though.
We can circle back later and attempt to generalize it if we so need or desire.
* Added case_sensitive_cols argument to generate_base_model macro * added all_args test * enable_case_sensitive_identifier for redshift * removed "" wrapping for bigquery
This is a:
main
dev/
branchdev/
branchDescription & motivation
I added an argument
case_sensitive_cols
togenerate_base_model
macro to allow this macro to still work for source tables with case sensitive column names.Checklist