mirror of
https://github.com/apache/superset.git
synced 2024-09-12 00:29:39 -04:00
fix(viz): BigQuery time grain 'minute'/'second' throws an error (#20350)
This commit is contained in:
parent
1ae935379f
commit
5afeba34bd
@ -123,8 +123,12 @@ class BigQueryEngineSpec(BaseEngineSpec):
|
||||
|
||||
_time_grain_expressions = {
|
||||
None: "{col}",
|
||||
"PT1S": "{func}({col}, SECOND)",
|
||||
"PT1M": "{func}({col}, MINUTE)",
|
||||
"PT1S": "CAST(TIMESTAMP_SECONDS("
|
||||
"UNIX_SECONDS(CAST({col} AS TIMESTAMP))"
|
||||
") AS {type})",
|
||||
"PT1M": "CAST(TIMESTAMP_SECONDS("
|
||||
"60 * DIV(UNIX_SECONDS(CAST({col} AS TIMESTAMP)), 60)"
|
||||
") AS {type})",
|
||||
"PT5M": "CAST(TIMESTAMP_SECONDS("
|
||||
"5*60 * DIV(UNIX_SECONDS(CAST({col} AS TIMESTAMP)), 5*60)"
|
||||
") AS {type})",
|
||||
|
Loading…
Reference in New Issue
Block a user