Skip to content

Commit c81258e

Browse files
authored
Fix(parser): allow using OVER token as unquoted identifier (#6338)
1 parent 65706e8 commit c81258e

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

sqlglot/parser.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,6 +544,7 @@ class Parser(metaclass=_Parser):
544544
TokenType.OFFSET,
545545
TokenType.OPERATOR,
546546
TokenType.ORDINALITY,
547+
TokenType.OVER,
547548
TokenType.OVERLAPS,
548549
TokenType.OVERWRITE,
549550
TokenType.PARTITION,

tests/dialects/test_sqlite.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ def test_ddl(self):
235235
with self.subTest(f"ON CONFLICT {conflict_action}"):
236236
self.validate_identity("CREATE TABLE a (b, c, UNIQUE (b, c) ON CONFLICT IGNORE)")
237237

238+
self.validate_identity("CREATE TABLE over (x, y)")
238239
self.validate_identity("INSERT OR ABORT INTO foo (x, y) VALUES (1, 2)")
239240
self.validate_identity("INSERT OR FAIL INTO foo (x, y) VALUES (1, 2)")
240241
self.validate_identity("INSERT OR IGNORE INTO foo (x, y) VALUES (1, 2)")

tests/test_transpile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def test_alias(self):
4646
"SELECT 1 FROM a.b.table1 AS t UNPIVOT((c3) FOR c4 IN (a, b))",
4747
)
4848

49-
for key in ("union", "over", "from", "join"):
49+
for key in ("union", "from", "join"):
5050
with self.subTest(f"alias {key}"):
5151
self.validate(f"SELECT x AS {key}", f"SELECT x AS {key}")
5252
self.validate(f'SELECT x "{key}"', f'SELECT x AS "{key}"')

0 commit comments

Comments
 (0)