You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the existing issues, and I could not find an existing issue for this bug
Current Behavior
When quoting is enabled for a source table column, the freshness query does not quote the loaded_at_field column.
Expected Behavior
The loaded_at_field column is quoted in the freshness query when quoting is enabled for the column in the source table definition.
Steps To Reproduce
Create a table with a lowercase loaded_at timestamp column in a Snowflake data warehouse.
Add a source for the table in DBT. Set the source setting loaded_at_field: loaded_at, and configure freshness checks. Set quote: true in the column configuration for loaded_at.
Run dbt source freshness.
Observe the error invalid identifier 'LOADED_AT'.
Relevant log output
07:51:19 Database Error insource search_analytics_all_fields (models/staging/google_search_console/google_search_console__sources.yml)
07:51:19 000904 (42000): SQL compilation error: error line 2 at position 10
07:51:19 invalid identifier '_AIRBYTE_EXTRACTED_AT'
github-actionsbot
changed the title
[Bug] Quoting not respected in freshness query
[CT-3074] [Bug] Quoting not respected in freshness query
Sep 5, 2023
The input to the loaded_at_field is actually just any string (you could put something like loaded_at_field: "convert_timezone('UTC', 'Australia/Sydney', created_at_local)" as your input) - it's not actually mapping to a specific column in your source. Because of this, it's not aware that quote: true.
You should be able to add quotes to your string like this loaded_at_field: "'loaded_at'". Let me know if that fixes this issue for you.
Is this a new bug in dbt-core?
Current Behavior
When quoting is enabled for a source table column, the freshness query does not quote the
loaded_at_field
column.Expected Behavior
The
loaded_at_field
column is quoted in the freshness query when quoting is enabled for the column in the source table definition.Steps To Reproduce
loaded_at
timestamp column in a Snowflake data warehouse.loaded_at_field: loaded_at
, and configure freshness checks. Setquote: true
in the column configuration forloaded_at
.dbt source freshness
.invalid identifier 'LOADED_AT'
.Relevant log output
Environment
Which database adapter are you using with dbt?
snowflake
Additional Context
No response
The text was updated successfully, but these errors were encountered: