mirror of
https://github.com/apache/superset.git
synced 2026-04-18 23:55:00 +00:00
feat: 10/15/30 min grain to Pinot (#19724)
* add new grains to pinot * update test
This commit is contained in:
@@ -45,6 +45,19 @@ class TestPinotDbEngineSpec(TestDbEngineSpec):
|
||||
),
|
||||
)
|
||||
|
||||
def test_pinot_time_expression_simple_date_format_10m_grain(self):
|
||||
col = column("tstamp")
|
||||
expr = PinotEngineSpec.get_timestamp_expr(col, "%Y-%m-%d %H:%M:%S", "PT10M")
|
||||
result = str(expr.compile())
|
||||
self.assertEqual(
|
||||
result,
|
||||
(
|
||||
"DATETIMECONVERT(tstamp, "
|
||||
+ "'1:SECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss', "
|
||||
+ "'1:SECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss', '10:MINUTES')"
|
||||
),
|
||||
)
|
||||
|
||||
def test_pinot_time_expression_simple_date_format_1w_grain(self):
|
||||
col = column("tstamp")
|
||||
expr = PinotEngineSpec.get_timestamp_expr(col, "%Y-%m-%d %H:%M:%S", "P1W")
|
||||
|
||||
Reference in New Issue
Block a user