[
https://issues.apache.org/jira/browse/CALCITE-6761?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
xiaochen.zhou updated CALCITE-6761:
-----------------------------------
Description:
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 '1987-01-31');
SELECT DAYOFYEAR(DATE '1987-01-31');
```
> 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 '1987-01-31');
> SELECT DAYOFYEAR(DATE '1987-01-31');
> ```
--
This message was sent by Atlassian Jira
(v8.20.10#820010)