Repository: tobymao/sqlglot

Issue:
bigquery options timestamp
```sql
CREATE VIEW `dataset.events`
OPTIONS(
  expiration_timestamp=TIMESTAMP "2020-01-02T04:05:06.007Z",
  description=""
)
AS
SELECT
    *
FROM
    dataset.events_raw;
```

Parsing fails on the `TIMESTAMP` cast within OPTIONS. 

This is pretty similar to their example in the docs - https://cloud.google.com/bigquery/docs/reference/standard-sql/data-definition-language#table_option_list. Other types (e.g interval) are also valid within OPTIONS.


Discussion:

Patch:
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
index be0b1084..fae0177a 100644
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -1728,7 +1728,7 @@ class Parser(metaclass=_Parser):
         return self.expression(
             exp.Property,
             this=key.to_dot() if isinstance(key, exp.Column) else key,
-            value=self._parse_column() or self._parse_var(any_token=True),
+            value=self._parse_bitwise() or self._parse_var(any_token=True),
         )
 
     def _parse_stored(self) -> exp.FileFormatProperty:


Test patch:
diff --git a/tests/dialects/test_bigquery.py b/tests/dialects/test_bigquery.py
index 1cad1a7d..f4af3f53 100644
--- a/tests/dialects/test_bigquery.py
+++ b/tests/dialects/test_bigquery.py
@@ -184,6 +184,10 @@ class TestBigQuery(Validator):
         self.validate_identity(
             "CREATE OR REPLACE VIEW test (tenant_id OPTIONS (description='Test description on table creation')) AS SELECT 1 AS tenant_id, 1 AS customer_id",
         )
+        self.validate_identity(
+            "CREATE VIEW `d.v` OPTIONS (expiration_timestamp=TIMESTAMP '2020-01-02T04:05:06.007Z') AS SELECT 1 AS c",
+            "CREATE VIEW `d.v` OPTIONS (expiration_timestamp=CAST('2020-01-02T04:05:06.007Z' AS TIMESTAMP)) AS SELECT 1 AS c",
+        )
         self.validate_identity(
             "SELECT ARRAY(SELECT AS STRUCT 1 a, 2 b)",
             "SELECT ARRAY(SELECT AS STRUCT 1 AS a, 2 AS b)",