Repository: tobymao/sqlglot

Issue:
SQLglot misinterprets keywords from other dialects for bigquery
**Fully reproducible code snippet**
```
sql = "select a overlaps, b from table"
schema = {"a": "INT", "b": "INT"}

from sqlglot.optimizer import optimize

optimize(sql, dialect = "bigquery")
```

Actual output
```
ParseError: Required keyword: 'expression' missing for <class 'sqlglot.expressions.Overlaps'>. Line 1, Col: 18.
  select a overlaps, b from table
```

Expected output
This should parse, since "overlaps" is not a reserved keyword in BQ, but it is in other dialects (e.g. [sqlserver](https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/ef/language-reference/overlaps-entity-sql).


Discussion:

Patch:
diff --git a/sqlglot/dialects/bigquery.py b/sqlglot/dialects/bigquery.py
index 10889104..3dd5c3f4 100644
--- a/sqlglot/dialects/bigquery.py
+++ b/sqlglot/dialects/bigquery.py
@@ -343,6 +343,9 @@ class BigQuery(Dialect):
             "OPTIONS": lambda self: exp.Properties(expressions=self._parse_with_property()),
         }
 
+        RANGE_PARSERS = parser.Parser.RANGE_PARSERS.copy()
+        RANGE_PARSERS.pop(TokenType.OVERLAPS, None)
+
         NULL_TOKENS = {TokenType.NULL, TokenType.UNKNOWN}
 
         def _parse_table_part(self, schema: bool = False) -> t.Optional[exp.Expression]:
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
index 5e6dd54e..e7606fc6 100644
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -285,6 +285,7 @@ class Parser(metaclass=_Parser):
         TokenType.NEXT,
         TokenType.OFFSET,
         TokenType.ORDINALITY,
+        TokenType.OVERLAPS,
         TokenType.OVERWRITE,
         TokenType.PARTITION,
         TokenType.PERCENT,


Test patch:
diff --git a/tests/dialects/test_bigquery.py b/tests/dialects/test_bigquery.py
index f7bcb6d0..1da3da29 100644
--- a/tests/dialects/test_bigquery.py
+++ b/tests/dialects/test_bigquery.py
@@ -106,6 +106,10 @@ class TestBigQuery(Validator):
         self.validate_identity(
             "SELECT LAST_VALUE(a IGNORE NULLS) OVER y FROM x WINDOW y AS (PARTITION BY CATEGORY)",
         )
+        self.validate_identity(
+            "SELECT a overlaps",
+            "SELECT a AS overlaps",
+        )
         self.validate_identity(
             "SELECT y + 1 z FROM x GROUP BY y + 1 ORDER BY z",
             "SELECT y + 1 AS z FROM x GROUP BY z ORDER BY z",