Max Gekk created SPARK-35037:
--------------------------------

             Summary: Recognize '-' before the interval string in literals
                 Key: SPARK-35037
                 URL: https://issues.apache.org/jira/browse/SPARK-35037
             Project: Spark
          Issue Type: Sub-task
          Components: SQL
    Affects Versions: 3.2.0
            Reporter: Max Gekk
            Assignee: Max Gekk


According to the SQL standard:

{code:java}
<interval literal> ::=
  INTERVAL [ <sign> ] <interval string> <interval qualifier>
<interval string> ::=
  <quote> <unquoted interval string> <quote>
<unquoted interval string> ::=
  [ <sign> ] { <year-month literal> | <day-time literal> }
<sign> ::=
    <plus sign>
  | <minus sign>
{code}
but the parsing fails:

{code:java}
spark-sql> select interval -'1-1' year to month;
Error in query:
mismatched input 'to' expecting {<EOF>, ';'}(line 1, pos 28)

== SQL ==
select interval -'1-1' year to month
----------------------------^^^
{code}





--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to