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/02/26 02:56:00 UTC

[jira] [Resolved] (CALCITE-5469) Implement BigQuery DATETIME_ADD/DATETIME_DIFF

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

Julian Hyde resolved CALCITE-5469.
----------------------------------
    Fix Version/s: 1.34.0
       Resolution: Fixed

Fixed in [cb97d299|https://github.com/apache/calcite/commit/cb97d299d2a04485a84916cff3f7be5497028b31]; thanks for the PR, [~tanclary]!

> Implement BigQuery DATETIME_ADD/DATETIME_DIFF
> ---------------------------------------------
>
>                 Key: CALCITE-5469
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5469
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: Tanner Clary
>            Assignee: Tanner Clary
>            Priority: Major
>              Labels: pull-request-available
>             Fix For: 1.34.0
>
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> Add support for BigQuery's {{DATETIME_ADD/DATETIME_DIFF}} functions.
> {{DATETIME_ADD(datetime, interval)}} can accept a timestamp (or a datetime, which is an alias for timestamp) for its first argument and an interval for its second. The output is the datetime that occurs {{interval}} after the provided {{datetime}}.
> {{DATETIME_DIFF(datetime, datetime2, timeUnit)}} returns the whole number of {{timeUnit}} between {{datetime}} and {{datetime2}}, with the result being negative if {{datetime}} occurs before {{datetime2}}
> Examples:
> {{DATETIME_ADD(TIMESTAMP '2008-12-25 15:30:00', INTERVAL 5 MINUTE)}} would return: '2008-12-25 15:35:00'.
> {{DATETIME_DIFF(DATETIME '2008-12-25 15:30:00', DATETIME '2008-12-26 15:30:00', DAY)}} would return: -1.



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