Skip to content

Commit

Permalink
Fix: clickhouse attach command closes #1608
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed May 12, 2023
1 parent b5f0abc commit d92964b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions sqlglot/dialects/clickhouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class Tokenizer(tokens.Tokenizer):
KEYWORDS = {
**tokens.Tokenizer.KEYWORDS,
"ASOF": TokenType.ASOF,
"ATTACH": TokenType.COMMAND,
"GLOBAL": TokenType.GLOBAL,
"DATETIME64": TokenType.DATETIME64,
"FINAL": TokenType.FINAL,
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 @@ -6,6 +6,7 @@ class TestClickhouse(Validator):
dialect = "clickhouse"

def test_clickhouse(self):
self.validate_identity("ATTACH DATABASE DEFAULT ENGINE = ORDINARY")
self.validate_identity("SELECT INTERVAL t.days day")
self.validate_identity("SELECT match('abc', '([a-z]+)')")
self.validate_identity("dictGet(x, 'y')")
Expand Down

0 comments on commit d92964b

Please sign in to comment.