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

Julian Hyde commented on CALCITE-5360:
--------------------------------------

I think all of the datetime arithmetic functions ({{TIMESTAMP_ADD}}, 
{{DATEADD}}, {{DATEDIFF}}) should work the same way, and accept identifiers as 
their 'time frame' argument. The identifiers might reference built-in time 
frames (e.g. {{HOUR}}) or user-defined time frames (e.g. {{HOUR3}}) but the 
validator will sort it out.

Hopefully {{TIMESTAMP_ADD}} maps directly to {{DATEADD}}, as {{TIMESTAMPADD}} 
already does.

> Implement BigQuery TIMESTAMP_ADD and TIMESTAMP_DIFF
> ---------------------------------------------------
>
>                 Key: CALCITE-5360
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5360
>             Project: Calcite
>          Issue Type: Sub-task
>          Components: core
>            Reporter: TJ Banghart
>            Assignee: TJ Banghart
>            Priority: Major
>
> Calcite already supports TIMESTAMPADD and TIMESTAMPDIFF. We should try 
> mapping the BQ style syntax to these already implemented functions.
> We did something similar for TIMESTAMP_TRUNC and TIME_TRUNC which 
> conveniently mapped to FLOOR in 
> [CALCITE-5269|https://issues.apache.org/jira/browse/CALCITE-5269]



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

Reply via email to