You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2023/01/13 01:32:00 UTC
[jira] [Updated] (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 ]
ASF GitHub Bot updated CALCITE-5469:
------------------------------------
Labels: pull-request-available (was: )
> 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
> Time Spent: 10m
> 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)