mirror of
https://github.com/apache/superset.git
synced 2026-04-19 08:04:53 +00:00
chore(druid): Explicitly cast col to TIMESTAMP (#17101)
Co-authored-by: John Bodley <john.bodley@airbnb.com>
This commit is contained in:
@@ -50,10 +50,10 @@ class TestDruidDbEngineSpec(TestDbEngineSpec):
|
||||
col = "__time"
|
||||
sqla_col = column(col)
|
||||
test_cases = {
|
||||
"PT1S": f"TIME_FLOOR({col}, 'PT1S')",
|
||||
"PT5M": f"TIME_FLOOR({col}, 'PT5M')",
|
||||
"P1W/1970-01-03T00:00:00Z": f"TIME_SHIFT(TIME_FLOOR(TIME_SHIFT({col}, 'P1D', 1), 'P1W'), 'P1D', 5)",
|
||||
"1969-12-28T00:00:00Z/P1W": f"TIME_SHIFT(TIME_FLOOR(TIME_SHIFT({col}, 'P1D', 1), 'P1W'), 'P1D', -1)",
|
||||
"PT1S": f"TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT1S')",
|
||||
"PT5M": f"TIME_FLOOR(CAST({col} AS TIMESTAMP), 'PT5M')",
|
||||
"P1W/1970-01-03T00:00:00Z": f"TIME_SHIFT(TIME_FLOOR(TIME_SHIFT(CAST({col} AS TIMESTAMP), 'P1D', 1), 'P1W'), 'P1D', 5)",
|
||||
"1969-12-28T00:00:00Z/P1W": f"TIME_SHIFT(TIME_FLOOR(TIME_SHIFT(CAST({col} AS TIMESTAMP), 'P1D', 1), 'P1W'), 'P1D', -1)",
|
||||
}
|
||||
for grain, expected in test_cases.items():
|
||||
actual = DruidEngineSpec.get_timestamp_expr(
|
||||
|
||||
Reference in New Issue
Block a user