cube-js / cube-js/cube

SQL Generation for BigQuery Seems To Be Failing

Open
#7,221 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Rust
Stars
20.8k
Forks
2.1k
Avg merge
1d 2h
Merged PRs (30d)
181

Description

I've created a super simple model for a table in my BigQuery database but the generated query from Cube throws a syntax error.

Here is the generated query:
`SELECT
DATETIME_TRUNC(DATETIME('covid_patient_impact'.date, 'UTC'), DAY) 'covid_patient_impact__date_day',
count('covid_patient_impact'.inpatient_beds_used_covid_coverage) 'covid_patient_impact__count'
FROM
test.sample_covid_patient_impact AS 'covid_patient_impact' GROUP BY 1 ORDER BY 1 ASC LIMIT 100`

This part: `DATETIME('covid_patient_impact'.date, 'UTC')` is throwing the error `Could not cast literal "UTC" to type TIME at [2:56]`. How do I fix this issue? I've tried using a `string` data type for that column but the same SQL code is generated so the same error is thrown.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.