fix(pinot): typo in the name for epoch_ms_to_dttm (#26906)
This commit is contained in:
parent
73d118c0e2
commit
484901f483
|
|
@ -62,7 +62,7 @@ class PinotEngineSpec(BaseEngineSpec):
|
|||
)
|
||||
|
||||
@classmethod
|
||||
def epoch_ms_to_dttm_(cls) -> str:
|
||||
def epoch_ms_to_dttm(cls) -> str:
|
||||
return (
|
||||
"DATETIMECONVERT({col}, '1:MILLISECONDS:EPOCH', "
|
||||
+ "'1:MILLISECONDS:EPOCH', '1:MILLISECONDS')"
|
||||
|
|
|
|||
|
|
@ -84,6 +84,20 @@ class TestPinotDbEngineSpec(TestDbEngineSpec):
|
|||
expected,
|
||||
)
|
||||
|
||||
def test_pinot_time_expression_millisec_one_1m_grain(self):
|
||||
col = column("tstamp")
|
||||
expr = PinotEngineSpec.get_timestamp_expr(col, "epoch_ms", "P1M")
|
||||
result = str(expr.compile())
|
||||
expected = (
|
||||
"CAST(DATE_TRUNC('month', CAST("
|
||||
+ "DATETIMECONVERT(tstamp, '1:MILLISECONDS:EPOCH', "
|
||||
+ "'1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS TIMESTAMP)) AS TIMESTAMP)"
|
||||
)
|
||||
self.assertEqual(
|
||||
result,
|
||||
expected,
|
||||
)
|
||||
|
||||
def test_invalid_get_time_expression_arguments(self):
|
||||
with self.assertRaises(NotImplementedError):
|
||||
PinotEngineSpec.get_timestamp_expr(column("tstamp"), None, "P0.25Y")
|
||||
|
|
|
|||
Loading…
Reference in New Issue