Repository: tobymao/sqlglot

Issue:
snowflake: transpiling "COPY INTO" raises ParseError
In snowflake I can do `COPY INTO NEW_TABLE ( "foo", "bar")  FROM ( SELECT $1, $2, $3, $4 FROM @%old_table)`.  In sqlglot I get `ParseError`:

```python
import sqlglot

print(sqlglot.transpile('COPY INTO NEW_TABLE ( "foo", "bar")  FROM ( SELECT $1, $2, $3, $4 FROM @%old_table)', 'snowflake'))
```

I'm on sqlglot 11.0.0, python 3.10.4.

Discussion:

Patch:
diff --git a/sqlglot/dialects/redshift.py b/sqlglot/dialects/redshift.py
index 0a6683f6..813ee5f2 100644
--- a/sqlglot/dialects/redshift.py
+++ b/sqlglot/dialects/redshift.py
@@ -41,7 +41,6 @@ class Redshift(Postgres):
 
         KEYWORDS = {
             **Postgres.Tokenizer.KEYWORDS,  # type: ignore
-            "COPY": TokenType.COMMAND,
             "ENCODE": TokenType.ENCODE,
             "GEOMETRY": TokenType.GEOMETRY,
             "GEOGRAPHY": TokenType.GEOGRAPHY,
diff --git a/sqlglot/tokens.py b/sqlglot/tokens.py
index 42978f61..8cf17a7e 100644
--- a/sqlglot/tokens.py
+++ b/sqlglot/tokens.py
@@ -697,6 +697,7 @@ class Tokenizer(metaclass=_Tokenizer):
         "ALTER VIEW": TokenType.COMMAND,
         "ANALYZE": TokenType.COMMAND,
         "CALL": TokenType.COMMAND,
+        "COPY": TokenType.COMMAND,
         "EXPLAIN": TokenType.COMMAND,
         "OPTIMIZE": TokenType.COMMAND,
         "PREPARE": TokenType.COMMAND,


Test patch:
diff --git a/tests/dialects/test_snowflake.py b/tests/dialects/test_snowflake.py
index be2e313c..201cc4e8 100644
--- a/tests/dialects/test_snowflake.py
+++ b/tests/dialects/test_snowflake.py
@@ -9,6 +9,9 @@ class TestSnowflake(Validator):
         self.validate_identity("SELECT REGEXP_LIKE(a, b, c)")
         self.validate_identity("PUT file:///dir/tmp.csv @%table")
         self.validate_identity("CREATE TABLE foo (bar FLOAT AUTOINCREMENT START 0 INCREMENT 1)")
+        self.validate_identity(
+            'COPY INTO NEW_TABLE ("foo", "bar") FROM (SELECT $1, $2, $3, $4 FROM @%old_table)'
+        )
 
         self.validate_all(
             "CREATE OR REPLACE TEMPORARY TABLE x (y NUMBER IDENTITY(0, 1))",