Skip to content

Commit 85845bb

Browse files
authored
fix(snowflake): allow exclude as id var (#5764)
1 parent 5172a99 commit 85845bb

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

sqlglot/dialects/snowflake.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,7 @@ class Parser(parser.Parser):
552552

553553
ID_VAR_TOKENS = {
554554
*parser.Parser.ID_VAR_TOKENS,
555+
TokenType.EXCEPT,
555556
TokenType.MATCH_CONDITION,
556557
}
557558

tests/dialects/test_snowflake.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ def test_snowflake(self):
8989
self.validate_identity("SELECT TRIM(COALESCE(TO_CHAR(CAST(c AS TIME)), '')) FROM t")
9090
self.validate_identity("SELECT GET_PATH(PARSE_JSON(foo), 'bar')")
9191
self.validate_identity("SELECT GET_PATH(foo, 'bar')")
92+
self.validate_identity("SELECT a, exclude, b FROM xxx")
9293
self.validate_identity(
9394
"SELECT * FROM table AT (TIMESTAMP => '2024-07-24') UNPIVOT(a FOR b IN (c)) AS pivot_table"
9495
)

0 commit comments

Comments
 (0)