You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@calcite.apache.org by "Ruben Q L (Jira)" <ji...@apache.org> on 2022/04/26 09:59:00 UTC

[jira] [Commented] (CALCITE-5113) function week(date 'xxx') return an error number

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

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

[~itxiangkui], if I understand your description, you are saying that MySql returns 0 for {{week(date '2022-01-01')}}, but Calcite returns 52?
If that is the case, I'd say that Calcite result is correct, according to how week 1 is computed (https://en.wikipedia.org/wiki/Week#Numbering)


> function week(date 'xxx') return an error number
> ------------------------------------------------
>
>                 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)