Skip to content

Commit de8fdaa

Browse files
Merge branch 'feature/transpile-to_timestamp' of https://github.com/tobymao/sqlglot into feature/transpile-to_timestamp
2 parents 6d29ebc + eb53461 commit de8fdaa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sqlglot/dialects/duckdb.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,11 @@ def _unix_to_time_sql(self: DuckDB.Generator, expression: exp.UnixToTime) -> str
407407
to_timestamp = exp.AtTimeZone(this=to_timestamp, zone=exp.Literal.string("UTC"))
408408
return self.sql(to_timestamp)
409409
if scale == exp.UnixToTime.MILLIS:
410+
# EPOCH_MS already returns TIMESTAMP (naive, UTC)
410411
# EPOCH_MS already returns TIMESTAMP (naive, UTC)
411412
return self.func("EPOCH_MS", timestamp)
412413
if scale == exp.UnixToTime.MICROS:
414+
# MAKE_TIMESTAMP already returns TIMESTAMP (naive, UTC)
413415
# MAKE_TIMESTAMP already returns TIMESTAMP (naive, UTC)
414416
return self.func("MAKE_TIMESTAMP", timestamp)
415417

0 commit comments

Comments
 (0)