You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Julian Hyde (Jira)" <ji...@apache.org> on 2023/06/13 23:14:00 UTC

[jira] [Commented] (CALCITE-5776) Support for alternative Interval syntax

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

Julian Hyde commented on CALCITE-5776:
--------------------------------------

Which DBMS supports this syntax? I know that:
* {{INTERVAL '7' DAY}} is standard;
* since CALCITE-3383 we allow {{INTERVAL '7' DAYS}}; and
* for BigQuery (CALCITE-4134) we allow {{INTERVAL (3 + 4) DAY}}.

> Support for alternative Interval syntax
> ---------------------------------------
>
>                 Key: CALCITE-5776
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5776
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Guillaume Massé
>            Priority: Minor
>
> {code:java}
> spark.sql("select (CURRENT_DATE - INTERVAL '7 DAYS') ").show
> +-----------------------------------------------------------------------+
> |date_add(current_date(), (- extractansiintervaldays(INTERVAL '7' DAY)))|
> +-----------------------------------------------------------------------+
> |                                                             2023-06-06|
> +-----------------------------------------------------------------------+ {code}
> currently the parser does not allows:
> {code:java}
> INTERVAL '7 DAYS' {code}
> it only accepts:
> {code:java}
> INTERVAL '7' DAYS {code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)