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

[jira] [Updated] (CALCITE-5447) Add DATE_TRUNC for BigQuery

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

Oliver Lee updated CALCITE-5447:
--------------------------------
    Description: 
Adding in BigQuery's definition of DATE_TRUNC as described [https://g3doc.corp.google.com/company/teams/googlesql/reference/date_functions.md?cl=head#date-trunc]

 

ex.

DATE_TRUNC('2022-01-05', month) -> 2022-01-01

DATE_TRUNC('2022-01-05', day) -> 2022-01-05

DATE_TRUNC('2022-01-05', year) -> 2022-01-01

 

 

Note: BigQuery says it'll support 
 * {{DAY}}
 * {{WEEK}}
 * {{{}WEEK(WEEKDAY){}}}following: {{{}SUNDAY{}}}, {{{}MONDAY{}}}, {{{}TUESDAY{}}}, {{{}WEDNESDAY{}}}, {{{}THURSDAY{}}}, {{{}FRIDAY{}}}, or {{{}SATURDAY{}}}.
 * {{ISOWEEK}}
 * {{MONTH}}
 * {{QUARTER}}
 * {{YEAR}}
 * {{ISOYEAR}}

but as of right now this ticket will only support 

 
 * {{DAY}}
 * {{WEEK}}
 * {{MONTH}}
 * {{QUARTER}}
 * {{{}{}}}{{{}YEAR{}}}

ISOWEEK, ISOYEAR is blocked by https://issues.apache.org/jira/browse/CALCITE-5369

and WEEK(WEEKDAY) will have a follow up PR as well{{{}{}}}

 

  was:
Adding in BigQuery's definition of DATE_TRUNC as described [https://g3doc.corp.google.com/company/teams/googlesql/reference/date_functions.md?cl=head#date-trunc]

 

ex.

DATE_TRUNC('2022-01-05', month) -> 2022-01-01

DATE_TRUNC('2022-01-05', day) -> 2022-01-05

DATE_TRUNC('2022-01-05', year) -> 2022-01-01


> Add DATE_TRUNC for BigQuery
> ---------------------------
>
>                 Key: CALCITE-5447
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5447
>             Project: Calcite
>          Issue Type: Improvement
>            Reporter: Oliver Lee
>            Assignee: Oliver Lee
>            Priority: Minor
>
> Adding in BigQuery's definition of DATE_TRUNC as described [https://g3doc.corp.google.com/company/teams/googlesql/reference/date_functions.md?cl=head#date-trunc]
>  
> ex.
> DATE_TRUNC('2022-01-05', month) -> 2022-01-01
> DATE_TRUNC('2022-01-05', day) -> 2022-01-05
> DATE_TRUNC('2022-01-05', year) -> 2022-01-01
>  
>  
> Note: BigQuery says it'll support 
>  * {{DAY}}
>  * {{WEEK}}
>  * {{{}WEEK(WEEKDAY){}}}following: {{{}SUNDAY{}}}, {{{}MONDAY{}}}, {{{}TUESDAY{}}}, {{{}WEDNESDAY{}}}, {{{}THURSDAY{}}}, {{{}FRIDAY{}}}, or {{{}SATURDAY{}}}.
>  * {{ISOWEEK}}
>  * {{MONTH}}
>  * {{QUARTER}}
>  * {{YEAR}}
>  * {{ISOYEAR}}
> but as of right now this ticket will only support 
>  
>  * {{DAY}}
>  * {{WEEK}}
>  * {{MONTH}}
>  * {{QUARTER}}
>  * {{{}{}}}{{{}YEAR{}}}
> ISOWEEK, ISOYEAR is blocked by https://issues.apache.org/jira/browse/CALCITE-5369
> and WEEK(WEEKDAY) will have a follow up PR as well{{{}{}}}
>  



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