Skip to content

Commit 4eb384a

Browse files
authored
fix(clickhouse): Remove CURRENT_TIMESTAMP from NO_PAREN_FUNCTIONS (#4079)
1 parent cc5b877 commit 4eb384a

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

sqlglot/dialects/clickhouse.py

+3
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ class Parser(parser.Parser):
403403
NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
404404
NO_PAREN_FUNCTION_PARSERS.pop("ANY")
405405

406+
NO_PAREN_FUNCTIONS = parser.Parser.NO_PAREN_FUNCTIONS.copy()
407+
NO_PAREN_FUNCTIONS.pop(TokenType.CURRENT_TIMESTAMP)
408+
406409
RANGE_PARSERS = {
407410
**parser.Parser.RANGE_PARSERS,
408411
TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)

tests/dialects/test_clickhouse.py

+1
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ def test_clickhouse(self):
515515
)
516516
self.validate_identity("SELECT TRIM(TRAILING ')' FROM '( Hello, world! )')")
517517
self.validate_identity("SELECT TRIM(LEADING '(' FROM '( Hello, world! )')")
518+
self.validate_identity("current_timestamp").assert_is(exp.Column)
518519

519520
def test_clickhouse_values(self):
520521
values = exp.select("*").from_(

0 commit comments

Comments
 (0)