-
Notifications
You must be signed in to change notification settings - Fork 161
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
Fix: Cast to timestamp prior to event time comparison #1422
Conversation
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-bigquery contributing guide. |
1 similar comment
Thank you for your pull request! We could not find a changelog entry for this change. For details on how to document a change, see the dbt-bigquery contributing guide. |
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.
YAAAAAY
(cherry picked from commit 4d255b2)
resolves #1412
docs dbt-labs/docs.getdbt.com/#
Problem
It's not currently possible to use microbatch models with inputs that aren't of type
timestamp
, because BigQuery does not coerce dates or datetimes to timestamps automatically when compared to literal timestamps.Solution
Cast
event_time
to timestamp on rendering, prior to comparing against timestamp literal.https://cloud.google.com/bigquery/docs/reference/standard-sql/conversion_functions#cast_as_timestamp
works for inputs of type:
(shoutout to @jtcohen6 for helping with this solutioning)
Checklist