[
https://issues.apache.org/jira/browse/SPARK-35037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Max Gekk resolved SPARK-35037.
------------------------------
Fix Version/s: 3.2.0
Resolution: Fixed
Issue resolved by pull request 32134
[https://github.com/apache/spark/pull/32134]
> Recognize sign 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
> Priority: Major
> Fix For: 3.2.0
>
>
> 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: [email protected]
For additional commands, e-mail: [email protected]