Skip to content

Commit

Permalink
fix(clickhouse): Remove CURRENT_TIMESTAMP from NO_PAREN_FUNCTIONS (#4079
Browse files Browse the repository at this point in the history
)
  • Loading branch information
VaggelisD authored Sep 6, 2024
1 parent cc5b877 commit 4eb384a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sqlglot/dialects/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ class Parser(parser.Parser):
NO_PAREN_FUNCTION_PARSERS = parser.Parser.NO_PAREN_FUNCTION_PARSERS.copy()
NO_PAREN_FUNCTION_PARSERS.pop("ANY")

NO_PAREN_FUNCTIONS = parser.Parser.NO_PAREN_FUNCTIONS.copy()
NO_PAREN_FUNCTIONS.pop(TokenType.CURRENT_TIMESTAMP)

RANGE_PARSERS = {
**parser.Parser.RANGE_PARSERS,
TokenType.GLOBAL: lambda self, this: self._match(TokenType.IN)
Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,7 @@ def test_clickhouse(self):
)
self.validate_identity("SELECT TRIM(TRAILING ')' FROM '( Hello, world! )')")
self.validate_identity("SELECT TRIM(LEADING '(' FROM '( Hello, world! )')")
self.validate_identity("current_timestamp").assert_is(exp.Column)

def test_clickhouse_values(self):
values = exp.select("*").from_(
Expand Down

0 comments on commit 4eb384a

Please sign in to comment.