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 2016/03/08 07:16:41 UTC

[jira] [Resolved] (CALCITE-1124) Add support for timestampadd / timestampdiff functions

     [ https://issues.apache.org/jira/browse/CALCITE-1124?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julian Hyde resolved CALCITE-1124.
----------------------------------
       Resolution: Fixed
    Fix Version/s: 1.7.0

Fixed in http://git-wip-us.apache.org/repos/asf/calcite/commit/0b9ea986, with some further enhancements in http://git-wip-us.apache.org/repos/asf/calcite/commit/4ac82a30 to implement them in Enumerable convention and expose them via JDBC function syntax. [~arina], Thanks for the PR!

> Add support for timestampadd / timestampdiff functions
> ------------------------------------------------------
>
>                 Key: CALCITE-1124
>                 URL: https://issues.apache.org/jira/browse/CALCITE-1124
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: next
>            Reporter: Arina Ielchiieva
>            Assignee: Julian Hyde
>              Labels: dialect
>             Fix For: 1.7.0
>
>
> When calling timestampadd / timestampdiff with first parameter:
> (SQL_TSI_)MICROSECOND ((SQL_TSI_)FRAC_SECOND (deprecated but we can leave for older versions compatibility)), (SQL_TSI_)SECOND, (SQL_TSI_)MINUTE, (SQL_TSI_)HOUR, (SQL_TSI_)DAY, (SQL_TSI_)WEEK, (SQL_TSI_)MONTH, (SQL_TSI_)QUARTER, (SQL_TSI_)YEAR
> (ex: timestampadd(second, 1, current_datetime), calcite throws an error:
> Caused by: org.apache.calcite.sql.parser.SqlParseException: Encountered "( SECOND" at line 1, column 25.
> Was expecting one of:
>     "(" "*" ...
>     "(" ")" ...
>     "(" "WITH" ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)