You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Apache Spark (Jira)" <ji...@apache.org> on 2021/04/12 20:20:00 UTC

[jira] [Commented] (SPARK-35037) Recognize sign before the interval string in literals

    [ https://issues.apache.org/jira/browse/SPARK-35037?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17319696#comment-17319696 ] 

Apache Spark commented on SPARK-35037:
--------------------------------------

User 'MaxGekk' has created a pull request for this issue:
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
>
> 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-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org