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

ZheHu commented on CALCITE-6761:
--------------------------------

Left one comment in your PR. Since 
[MySQL|https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_extract]
 also doesn't support DOW and DOY, maybe we should fix it in MysqlDialect.

> StarRocks generates incorrect SQL for certain units in the EXTRACT function
> ---------------------------------------------------------------------------
>
>                 Key: CALCITE-6761
>                 URL: https://issues.apache.org/jira/browse/CALCITE-6761
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: xiaochen.zhou
>            Priority: Major
>              Labels: pull-request-available
>
> StarRocks does not support the following `EXTRACT` unit syntax, and 
> `StarRocksSqlDialect` may require some adjustments to accommodate this.
> For example:
> ```
> SELECT EXTRACT(DOW FROM DATE '2023-12-01');
> SELECT EXTRACT(DOY FROM DATE '2023-12-01');
> ```
> To ensure compatibility during the StarRocks dialect conversion, the above 
> syntax can be translated as follows:
> ```
> SELECT DAYOFWEEK(DATE '2023-12-01');
> SELECT DAYOFYEAR(DATE '2023-12-01');
> ```



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

Reply via email to