Skip to content

Commit

Permalink
Fix: add exp.Neg to UNWRAPPED_INTERVAL_VALUES (#1662)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgesittas authored May 19, 2023
1 parent e7f6455 commit 2cefcaa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sqlglot/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__"

Expand Down
1 change: 1 addition & 0 deletions tests/dialects/test_spark.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ def test_hint(self):
)

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')")
Expand Down

0 comments on commit 2cefcaa

Please sign in to comment.