Skip to content

Commit 7866b48

Browse files
fix(druid): support current_timestamp (tobymao#5061)
* feat: added support for current_timestamp * test: Added tests for current_timestamp --------- Co-authored-by: Jo <[email protected]>
1 parent 60f9420 commit 7866b48

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sqlglot/dialects/druid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ class Generator(generator.Generator):
1515

1616
TRANSFORMS = {
1717
**generator.Generator.TRANSFORMS,
18+
exp.CurrentTimestamp: lambda *_: "CURRENT_TIMESTAMP",
1819
exp.Mod: rename_func("MOD"),
1920
}

tests/dialects/test_druid.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ def test_druid(self):
1313
self.validate_identity("SELECT FLOOR(__time TO WEEK) FROM t")
1414
self.validate_identity("SELECT FLOOR(col) FROM t")
1515
self.validate_identity("SELECT FLOOR(price, 2) AS rounded_price FROM t")
16+
self.validate_identity("SELECT CURRENT_TIMESTAMP")
1617

1718
# validate across all dialects
1819
write = {dialect.value: "FLOOR(__time TO WEEK)" for dialect in Dialects}

0 commit comments

Comments
 (0)