You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Marieke Gueye (Jira)" <ji...@apache.org> on 2022/12/20 00:34:00 UTC

[jira] [Comment Edited] (CALCITE-5290) Add DATE_TRUNC function consistent with Postgres

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

Marieke Gueye edited comment on CALCITE-5290 at 12/20/22 12:33 AM:
-------------------------------------------------------------------

[~julianhyde] I am a bit confused by this are we suggesting that in our project:
1. We add date_trunc consistent with postgres
2. We add an alias for Google SQL ?
I have a problem with this for two reason:
- This is not consistent with what was previously done there 
[https://github.com/apache/calcite/commit/a505b25eacc473c6ec0ef8abd40c1ccae86297b6] 
- There is an error in the specs there, DATE_TRUNC in postgres does not accept any DATE arguments. 


was (Author: mkou):
[~julianhyde] I am a bit confused by this are we suggesting that in our project:
1. We add date_trunc consistent with postgres
2. We add an alias for Google SQL ?
This is not consistent with what was previously done there 
[https://github.com/apache/calcite/commit/a505b25eacc473c6ec0ef8abd40c1ccae86297b6] 

> Add DATE_TRUNC function consistent with Postgres
> ------------------------------------------------
>
>                 Key: CALCITE-5290
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5290
>             Project: Calcite
>          Issue Type: Bug
>            Reporter: Julian Hyde
>            Priority: Major
>
> Add {{DATE_TRUNC}} function consistent with Postgres. Per the [specification|https://www.postgresql.org/docs/current/functions-datetime.html#FUNCTIONS-DATETIME-TRUNC], syntax is as follows:
> {code}
> DATE_TRUNC(<string>, <timestamp | date | time>)
> {code}
> It is a different (and more complex) specification than BigQuery's DATE_TRUNC (see CALCITE-5180), which has the following syntax:
> {code}
> DATE_TRUNC(<date>, <interval>)
> {code}
> Postgres DATE_TRUNC would be implemented after CALCITE-5155 and would allow user-defined time frames in the {{field}} argument.



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