Repository: tobymao/sqlglot

Issue:
SparkSQL negative intervals are being generated incorrectly
```
>>> x = sqlglot.parse_one("INTERVAL -86 days", read="spark")
>>> x.sql(dialect="spark")
'INTERVAL (-86) days'
```

SparkSQL fails on `INTERVAL (-86) days` but will accept `INTERVAL '-86' days` or `INTERVAL -86 days`.

Discussion:

Patch:
diff --git a/sqlglot/generator.py b/sqlglot/generator.py
index 2a8c78f1..5949bd8b 100644
--- a/sqlglot/generator.py
+++ b/sqlglot/generator.py
@@ -232,7 +232,7 @@ class Generator:
 
     RESERVED_KEYWORDS: t.Set[str] = set()
     WITH_SEPARATED_COMMENTS = (exp.Select, exp.From, exp.Where, exp.With)
-    UNWRAPPED_INTERVAL_VALUES = (exp.Literal, exp.Paren, exp.Column)
+    UNWRAPPED_INTERVAL_VALUES = (exp.Column, exp.Literal, exp.Neg, exp.Paren)
 
     SENTINEL_LINE_BREAK = "__SQLGLOT__LB__"
 


Test patch:
diff --git a/tests/dialects/test_spark.py b/tests/dialects/test_spark.py
index 932e1ba0..bcfd9845 100644
--- a/tests/dialects/test_spark.py
+++ b/tests/dialects/test_spark.py
@@ -214,6 +214,7 @@ TBLPROPERTIES (
         )
 
     def test_spark(self):
+        self.validate_identity("INTERVAL -86 days")
         self.validate_identity("SELECT UNIX_TIMESTAMP()")
         self.validate_identity("TRIM('    SparkSQL   ')")
         self.validate_identity("TRIM(BOTH 'SL' FROM 'SSparkSQLS')")