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

Ruben Q L commented on CALCITE-5113:
------------------------------------

Thanks for the confirmation [~itxiangkui].
Regarding your last comment, according to Calcite doc 
(https://calcite.apache.org/docs/reference.html#datetime-functions) WEEK 
function only takes one parameter. It seems that internally the expression 
{{select WEEK(date '2022-01-01')}} is converted into {{select EXTRACT(WEEK FROM 
date '2022-01-01')}}, so maybe any extra parameter is just ignored in this 
conversion.

> function week(date 'xxx') returns a different number than mysql
> ---------------------------------------------------------------
>
>                 Key: CALCITE-5113
>                 URL: https://issues.apache.org/jira/browse/CALCITE-5113
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.30.0
>            Reporter: itxiangkui
>            Priority: Major
>
> {code:java}
> mysql> select week(date '2022-01-01');
> +-------------------------+
> | week(date '2022-01-01') |
> +-------------------------+
> |                       0 |
> +-------------------------+
> 1 row in set (0.01 sec)
>  {code}
>  
> {code:java}
> 0: jdbc:avatica:remote:url=http://xxxxx > select week(date '2022-01-01');
> +--------+
> | EXPR$0 |
> +--------+
> | 52     |
> +--------+ {code}
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to