Summary
On BigQuery, a date filter pointed at a TIMESTAMP column fails at query time. Evidence emits a DATE literal, and BigQuery does not implicitly coerce DATE to TIMESTAMP in a comparison.
Environment
- Evidence CLI v0.9.3 (latest)
- BigQuery direct connector
Steps to reproduce
Given a table whose time column is TIMESTAMP (start_time):
{% range_calendar id="dates" value_column="start_time" default_range="last 7 days" /%}
{% pie_chart data="my_table" category="some_column" value="count(*)" filters=["dates"] /%}
Actual
Every component bound to that filter renders an error instead of a chart:
No matching signature for operator >= for argument types: TIMESTAMP, DATE
Signature: T1 >= T1
Unable to find common supertype for templated argument <T1>
Input types for <T1>: {DATE, TIMESTAMP} at [18:9]
Expected
The filter should work against a TIMESTAMP column — either by casting the column (DATE(col) >= DATE '…') or by emitting a TIMESTAMP literal.
Workaround
Cast in the query and point value_column at the cast column:
select date(start_time) as start_date, ...
from my_dataset.my_table
{% range_calendar id="dates" value_column="start_date" default_range="last 7 days" /%}
Impact
Medium. There is a clean workaround, but the failure mode is confusing: the calendar and every dependent component break at once, and the error surfaces as a SQL type error with no hint that it originates in the date filter. TIMESTAMP is the natural type for event time columns in BigQuery, so this is likely to hit most BigQuery users.
Summary
On BigQuery, a date filter pointed at a
TIMESTAMPcolumn fails at query time. Evidence emits aDATEliteral, and BigQuery does not implicitly coerceDATEtoTIMESTAMPin a comparison.Environment
Steps to reproduce
Given a table whose time column is
TIMESTAMP(start_time):{% range_calendar id="dates" value_column="start_time" default_range="last 7 days" /%} {% pie_chart data="my_table" category="some_column" value="count(*)" filters=["dates"] /%}Actual
Every component bound to that filter renders an error instead of a chart:
Expected
The filter should work against a
TIMESTAMPcolumn — either by casting the column (DATE(col) >= DATE '…') or by emitting aTIMESTAMPliteral.Workaround
Cast in the query and point
value_columnat the cast column:{% range_calendar id="dates" value_column="start_date" default_range="last 7 days" /%}Impact
Medium. There is a clean workaround, but the failure mode is confusing: the calendar and every dependent component break at once, and the error surfaces as a SQL type error with no hint that it originates in the date filter.
TIMESTAMPis the natural type for event time columns in BigQuery, so this is likely to hit most BigQuery users.