-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Rationalize quoting configs + properties #2986
Comments
|
|
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please remove the stale label or comment on the issue, or it will be closed in 7 days. |
I still care about this one :) |
I really care about this one! All I want to do is ensure that dbt quotes all column names that I reference or create (via sql selects) and my only option right now is to explicitly define every single column in every single model. I've not actually tried doing that but I suspect that will only quote OUTPUT columns in a model, not columns that I select during my sql. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Here's a couple other issues related to quoting (specifically about applying proper escaping prior to quoting):
|
this is in adapters now, but also adding that seeds are not consistently quoted and it would be cool if they were also a config option under the proposed |
See also:
|
Adding ~quoting related issue for snapshots. #10356 cc: @jeremyyeo |
Describe the feature
Picks up from issues like #2468 and #2975, which are narrower in scope and offer more straightforward near-term fixes
quoting
when configuring database/schema/identifier names, but thenquote
when describing properties of column names?quote_columns
, which is a seed-only config item that lives on its own level but surely belongs inside thequoting
config item (or will it bequote
?!) ascolumns
quoted
, which while not itself a config, returns the quoted version of a column name from a Relation based on the configs aboveInstead, we should have a single config/property, and I think it should be
quote
. This would take over from the current project-levelquoting
config:The
quote: {columns: true}
would also replacequote_columns
as a bespoke config for seeds. If that config is specified indbt_project.yml
, it can be superseded by:quote: {}
inside theconfig()
block for a specific moelquote: true|false
set for a specific column inmodels/*.yml
(it's implied that this really meansquote: {column: true}
model
can set itsquote: {}
config withinmodels/*.yml
, tooIf
quote
is not set, it falls back to the default behavior of the adapter plugin, which also sets the character used for quoting (almost always"
or`
).Questions
Here's what we have in the docs FAQs today for sources:
Should sources start respecting project-level
quote
settings? Or they continue to act independently, but we should enable turning this config-property on or off for all sources indbt_project.yml
:Describe alternatives you've considered
Retaining all of these configs/properties/adapter methods and documenting them exceptionally well so as to avoid confusion
Additional context
This isn't specific to any one database, though it is likely most helpful on databases that support special characters if quoted (Postgres, Redshift) or are particularly sensitive to quoting (Snowflake).
There's a round-up of all the known documentation related to quoting in dbt-labs/docs.getdbt.com#3518.
The text was updated successfully, but these errors were encountered: