File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
tests/integration_tests/db_engine_specs Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ def epoch_to_dttm(cls) -> str:
62
62
)
63
63
64
64
@classmethod
65
- def epoch_ms_to_dttm_ (cls ) -> str :
65
+ def epoch_ms_to_dttm (cls ) -> str :
66
66
return (
67
67
"DATETIMECONVERT({col}, '1:MILLISECONDS:EPOCH', "
68
68
+ "'1:MILLISECONDS:EPOCH', '1:MILLISECONDS')"
Original file line number Diff line number Diff line change @@ -84,6 +84,20 @@ def test_pinot_time_expression_sec_one_1m_grain(self):
84
84
expected ,
85
85
)
86
86
87
+ def test_pinot_time_expression_millisec_one_1m_grain (self ):
88
+ col = column ("tstamp" )
89
+ expr = PinotEngineSpec .get_timestamp_expr (col , "epoch_ms" , "P1M" )
90
+ result = str (expr .compile ())
91
+ expected = (
92
+ "CAST(DATE_TRUNC('month', CAST("
93
+ + "DATETIMECONVERT(tstamp, '1:MILLISECONDS:EPOCH', "
94
+ + "'1:MILLISECONDS:EPOCH', '1:MILLISECONDS') AS TIMESTAMP)) AS TIMESTAMP)"
95
+ )
96
+ self .assertEqual (
97
+ result ,
98
+ expected ,
99
+ )
100
+
87
101
def test_invalid_get_time_expression_arguments (self ):
88
102
with self .assertRaises (NotImplementedError ):
89
103
PinotEngineSpec .get_timestamp_expr (column ("tstamp" ), None , "P0.25Y" )
You can’t perform that action at this time.
0 commit comments