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

Norman Jordan commented on CALCITE-6311:
----------------------------------------

The current implementation gets TimeUnit names from here:

[https://github.com/apache/calcite/blob/main/core/src/main/codegen/templates/Parser.jj#L5328]

 

This means that Redshift will support *ISODOW* and {*}ISOYEAR{*}, which are not 
supported in RedShift.

[https://docs.aws.amazon.com/redshift/latest/dg/r_Dateparts_for_datetime_functions.html]

 

This query is also supported by the parser:
{code:java}
SELECT date_part(WEEK(TUESDAY), TIMESTAMP '2022-06-03 12:15:48.678'); {code}
but will fail with an NPE.

 

None of the abbreviations are supported.

> Support PostgreSQL DATE_PART
> ----------------------------
>
>                 Key: CALCITE-6311
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6311
>             Project: Calcite
>          Issue Type: Sub-task
>            Reporter: James Duong
>            Assignee: Norman Jordan
>            Priority: Minor
>
> * PostgreSQL and Redshift let the date_part parameter be a string instead of 
> a just an enum-like identifier (eg DATE_PART('year', ...) and DATE_PART(year, 
> ...) are both supported.
>  * SQL Server does not support using a string here.



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

Reply via email to