goccy / go-zetasqlite

A database driver library that interprets ZetaSQL queries and runs them using SQLite3
MIT License
56 stars 29 forks source link

Support DATE_TRUNC with HOUR granularity #224

Open anowinski-equinix opened 3 weeks ago

anowinski-equinix commented 3 weeks ago

Currently DATE_TRUNC is supported only with resolution up to DAY (seems to use 'date_granularity' as described on https://cloud.google.com/bigquery/docs/reference/standard-sql/date_functions#date_trunc ).

Please add support for HOUR granularity (and for other datetime_granularity values, like MINUTE or SECOND).

Current implementation fails on 'HOUR' resolution with message: "failed to scan rows: unexpected part value HOUR"