Skip to content

Commit

Permalink
fix(presto): allow qualify to be an alias closes #3287
Browse files Browse the repository at this point in the history
  • Loading branch information
tobymao committed Apr 8, 2024
1 parent 0690cbc commit a37d231
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sqlglot/dialects/presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ class Tokenizer(tokens.Tokenizer):
"IPPREFIX": TokenType.IPPREFIX,
}

KEYWORDS.pop("QUALIFY")

class Parser(parser.Parser):
VALUES_FOLLOWED_BY_PAREN = False

Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_presto.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class TestPresto(Validator):
dialect = "presto"

def test_cast(self):
self.validate_identity("SELECT * FROM x qualify", "SELECT * FROM x AS qualify")
self.validate_identity("CAST(x AS IPADDRESS)")
self.validate_identity("CAST(x AS IPPREFIX)")

Expand Down

0 comments on commit a37d231

Please sign in to comment.