Skip to content

Commit cde7f15

Browse files
wendy-awrishsriv
authored andcommitted
fix invalid insertion
1 parent 28e84d7 commit cde7f15

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

utils_dialects.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ def replace_timestamp_trunc(match):
274274
r"'MMMM'",
275275
translated_ddl,
276276
)
277+
# replace DATEDIFF(SECOND, '1970-01-01'...* 1000 with CAST(DATEDIFF(SECOND, '1970-01-01'... as BIGINT) * 1000
278+
translated_ddl = re.sub(
279+
r"DATEDIFF\(SECOND, '1970-01-01', (.+?)\) \* 1000",
280+
r"CAST(DATEDIFF(SECOND, '1970-01-01', \1) AS BIGINT) * 1000",
281+
translated_ddl,
282+
)
277283
return translated_ddl
278284

279285

0 commit comments

Comments
 (0)