Repository: tobymao/sqlglot

Issue:
Required keyword: 'this' missing for <class 'sqlglot.expressions.CommentColumnConstraint'> with Snowflake
Here is the code to reproduce:

```python
from sqlglot import parse_one

print(parse_one("""create or replace  temporary view test_view
   
(
  
    "EVENT_ID" COMMENT $$A UUID for each event$$, 
  
    "TITLE" COMMENT $$The title of the shareable list item.$$, 
  
   
)

   as (

    select "EVENT_ID", "TITLE"
    from test
    
)
;""", dialect='snowflake', ).dump())
```
results in the following stacktrace:
```
Traceback (most recent call last):
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/src/query.py", line 40, in <module>
    print(parse_one("""create or replace  temporary view test_view
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/__init__.py", line 126, in parse_one
    result = dialect.parse(sql, **opts)
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/dialects/dialect.py", line 320, in parse
    return self.parser(**opts).parse(self.tokenize(sql), sql)
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1004, in parse
    return self._parse(
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1070, in _parse
    expressions.append(parse_method(self))
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1254, in _parse_statement
    return self.STATEMENT_PARSERS[self._prev.token_type](self)
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 555, in <lambda>
    TokenType.CREATE: lambda self: self._parse_create(),
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1367, in _parse_create
    this = self._parse_schema(this=table_parts)
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 3891, in _parse_schema
    args = self._parse_csv(lambda: self._parse_constraint() or self._parse_field_def())
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 4955, in _parse_csv
    parse_result = parse_method()
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 3891, in <lambda>
    args = self._parse_csv(lambda: self._parse_constraint() or self._parse_field_def())
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 3897, in _parse_field_def
    return self._parse_column_def(self._parse_field(any_token=True))
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 3922, in _parse_column_def
    constraint = self._parse_column_constraint()
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 4038, in _parse_column_constraint
    kind=self.CONSTRAINT_PARSERS[self._prev.text.upper()](self),
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 733, in <lambda>
    "COMMENT": lambda self: self.expression(
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1134, in expression
    return self.validate_expression(instance)
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1154, in validate_expression
    self.raise_error(error_message)
  File "/Users/mozilla/projects/moso-data-ops-poc/data-flows/.venv/lib/python3.10/site-packages/sqlglot/parser.py", line 1114, in raise_error
    raise error
sqlglot.errors.ParseError: Required keyword: 'this' missing for <class 'sqlglot.expressions.CommentColumnConstraint'>. Line 5, Col: 48.
  create or replace  temporary view test_view
   
(
  
    "EVENT_ID" COMMENT $$A UUID for each event$$, 
  
    "TITLE" COMMENT $$The title of the shareable list item.$$, 
  
   
)

   as (

    select 
```

While this gets figured out, is there a way to disable or skip this parsing?  These comments are not crucial to my use case at the moment.  Also please let me know how I can help.


Discussion:
You can parse it with 
```python
print(parse_one("""create or replace  temporary view test_view
   
(
  
    "EVENT_ID" COMMENT $$A UUID for each event$$, 
  
    "TITLE" COMMENT $$The title of the shareable list item.$$, 
  
   
)

   as (

    select "EVENT_ID", "TITLE"
    from test
    
)
;""", dialect='snowflake', error_level=ErrorLevel.IGNORE ).dump())
```

Just that the output is then incomplete.
ah I see, so it works but then stuff is missing....like the source table idenfier

```python
{
    "class": "Create",
    "args": {
        "this": {
            "class": "Schema",
            "args": {
                "this": {
                    "class": "Table",
                    "args": {
                        "this": {
                            "class": "Identifier",
                            "args": {"this": "test_view", "quoted": False},
                        }
                    },
                },
                "expressions": [
                    {
                        "class": "ColumnDef",
                        "args": {
                            "this": {
                                "class": "Identifier",
                                "args": {"this": "EVENT_ID", "quoted": True},
                            },
                            "constraints": [
                                {
                                    "class": "ColumnConstraint",
                                    "args": {
                                        "kind": {
                                            "class": "CommentColumnConstraint",
                                            "args": {},
                                        }
                                    },
                                }
                            ],
                        },
                    }
                ],
            },
        },
        "kind": "view",
        "replace": True,
        "exists": False,
        "properties": {
            "class": "Properties",
            "args": {"expressions": [{"class": "TemporaryProperty", "args": {}}]},
        },
    },
}
```

Resolving patch:
diff --git a/sqlglot/parser.py b/sqlglot/parser.py
--- a/sqlglot/parser.py
+++ b/sqlglot/parser.py
@@ -4858,8 +4858,8 @@ def _parse_id_var(
         return None
 
     def _parse_string(self) -> t.Optional[exp.Expression]:
-        if self._match(TokenType.STRING):
-            return self.PRIMARY_PARSERS[TokenType.STRING](self, self._prev)
+        if self._match_set((TokenType.STRING, TokenType.RAW_STRING)):
+            return self.PRIMARY_PARSERS[self._prev.token_type](self, self._prev)
         return self._parse_placeholder()
 
     def _parse_string_as_identifier(self) -> t.Optional[exp.Identifier]:


Test patch:
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -47,6 +47,10 @@ def test_snowflake(self):
         self.validate_identity(
             'DESCRIBE TABLE "SNOWFLAKE_SAMPLE_DATA"."TPCDS_SF100TCL"."WEB_SITE" type=stage'
         )
+        self.validate_identity(
+            "CREATE TABLE foo (ID INT COMMENT $$some comment$$)",
+            "CREATE TABLE foo (ID INT COMMENT 'some comment')",
+        )
         self.validate_identity(
             "SELECT state, city, SUM(retail_price * quantity) AS gross_revenue FROM sales GROUP BY ALL"
         )