[
https://issues.apache.org/jira/browse/CALCITE-6761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
ZheHu resolved CALCITE-6761.
----------------------------
Fix Version/s: 1.39.0
Resolution: Fixed
Fixed in
[05841d7|https://github.com/apache/calcite/commit/05841d726cc0d1a3507e4092d44ae7bc8257555f],
thank you for the PR [~xiaochen.hello].
Thanks for the review [~caicancai].
> 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
> Fix For: 1.39.0
>
>
> 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)