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
However, the compiled SQL has the following issues:
There are a few column names that need to be wrapped in double quotes for Snowflake : source, activity and timestamp — if not, they show up as invalid identifiers with the following error : invalid identifier 'TIMESTAMP'
The timestamp filter mentioned in the metric is showing up as a filter where 1=1 and timestamp >= 2021-01-01 in the compiled SQL. This is missing quotes around timestamp and the date 2021-01-01
Once we copied over the SQL and updated the quotes around identifiers/dates, the metric creation completed successfully!
The text was updated successfully, but these errors were encountered:
shubh24
changed the title
Quotations around Identifiers/Timestamps in compiled SQL for Snowflake
Quotes around Identifiers/Timestamps in compiled SQL for Snowflake
Feb 25, 2022
Note that value must be defined as a string in YAML, because it will be compiled into queries as part of a string. If your filter's value needs to be surrounded in quotes inside the query, use "'nested'" quotes
I'm going to close this because it's able to be handled by an extra set of quotes, but wanted to let you know that we also have dbt-labs/dbt-core#4294 to track similar ergonomic issues.
We’ve started using metrics_store for experiments and are using Snowflake as the connected data warehouse.
Our metric definition looks like the following, here we are counting the number of events ingested from Segment or Amplitude per day/week/month.
The model used for calculation of the metrics is as follows(borrowed from the example shown in the Readme)
However, the compiled SQL has the following issues:
invalid identifier 'TIMESTAMP'
where 1=1 and timestamp >= 2021-01-01
in the compiled SQL. This is missing quotes around timestamp and the date2021-01-01
Once we copied over the SQL and updated the quotes around identifiers/dates, the metric creation completed successfully!
The text was updated successfully, but these errors were encountered: