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 2018/05/30 22:52:00 UTC

[jira] [Comment Edited] (CALCITE-2339) JDBC adapter should transform timestamp arithmetic for target database

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

Julian Hyde edited comment on CALCITE-2339 at 5/30/18 10:51 PM:
----------------------------------------------------------------

I propose that we continue to use interval "\+" as the internal representation, but writer a converter from an interval "\+" expression to a TIMESTAMPADD expression that can be used by various dialects in the JDBC adapter.

The only downside I can see is that someone might write {{TIMESTAMPADD(ts, 3, WEEK)}} and see {{TIMESTAMPADD(ts, 21, DAY)}} sent to the underlying DB. That's not too bad.  The standard intervals day, month, year, hour, second etc will not be affected.


was (Author: julianhyde):
I propose that we continue to use interval "+" as the internal representation, but writer a converter from an interval "+" expression to a TIMESTAMPADD expression that can be used by various dialects in the JDBC adapter.

The only downside I can see is that someone might write {{TIMESTAMPADD(ts, 3, WEEK)}} and see {{TIMESTAMPADD(ts, 21, DAY)}} sent to the underlying DB. That's not too bad.  The standard intervals day, month, year, hour, second etc will not be affected.

> JDBC adapter should transform timestamp arithmetic for target database 
> -----------------------------------------------------------------------
>
>                 Key: CALCITE-2339
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2339
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Assignee: Julian Hyde
>            Priority: Major
>         Attachments: Datetime Addition - Calcite.pdf
>
>
> JDBC adapter should transform timestamp arithmetic for target database.
> There are two ways in Calcite to add intervals to timestamps: the TIMESTAMP_ADD function and the "<timestamp> + <interval>" operator.
> The attached document (authored by James Doung) describes their pros and cons.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)