google / zetasql

ZetaSQL - Analyzer Framework for SQL
Apache License 2.0
2.32k stars 219 forks source link

DATE_TRUNC function not working when date is passed #132

Closed masterlittle closed 1 year ago

masterlittle commented 1 year ago

I'm seeing this error when I run the parser over a query which has date_trunc input as string. The same query works in the Bigquery console. Any idea what could be the issue?

No matching signature for function DATE_TRUNC for argument types: STRING, DATE_TIME_PART. Supported signatures: DATE_TRUNC(DATE, DATE_TIME_PART); DATE_TRUNC(DATETIME, DATE_TIME_PART); DATE_TRUNC(TIMESTAMP, DATE_TIME_PART, [STRING]) [at 434:10] . com.google.zetasql.io.grpc.StatusRuntimeException: INVALID_ARGUMENT: No matching signature for function DATE_TRUNC for argument types: STRING, DATE_TIME_PART. Supported signatures: DATE_TRUNC(DATE, DATE_TIME_PART); DATE_TRUNC(DATETIME, DATE_TIME_PART); DATE_TRUNC(TIMESTAMP, DATE_TIME_PART, [STRING]) [at 434:10]