[
https://issues.apache.org/jira/browse/CALCITE-5369?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Julian Hyde updated CALCITE-5369:
---------------------------------
Description:
In Avatica DateTimeUtils, add support for computing the FLOOR and CEIL of a
date to ISOYEAR.
For example:
* {{FLOOR(DATE '1900-01-01' TO ISOYEAR)}} should return {{DATE '1900-01-01'}}
(because 1900-01-01 is a Monday and an ISO year starts on a Monday)
* {{FLOOR(DATE '1901-01-01' TO ISOYEAR)}} should return {{DATE '1900-12-31'}}
(because 1901-01-01 is a Tuesday and 1900-12-31 is the preceding Monday)
* {{FLOOR(DATE '1903-01-01' TO ISOYEAR)}} should return {{DATE '1902-12-29'}}
(because 1903-01-01 is a Thursday and 1902-12-29 is the nearest Monday)
* {{FLOOR(DATE '1904-01-01' TO ISOYEAR)}} should return {{DATE '1902-12-29'}}
(because 1904-01-01 is a Friday, 1904-01-04 is start of the next ISO year, but
1904-01-01 falls into the previous ISO year)
* {{FLOOR(DATE '1906-01-01' TO ISOYEAR)}} should return {{DATE '1906-01-01'}}
(because 1906-01-01 is a Monday, therefore the start of an ISO year)
was:
In Avatica DateTimeUtils, add support for computing the FLOOR and CEIL of a
date to ISOYEAR.
For example:
* {{FLOOR(DATE '1900-01-01' TO ISOYEAR)}} should return {{DATE '1900-01-01'}}
(because 1900-01-01 is a Monday and an ISO year starts on a Monday)
* {{FLOOR(DATE '1901-01-01' TO ISOYEAR)}} should return {{DATE '1900-12-31'}}
(because 1901-01-01 is a Tuesday and 1900-12-31 is the preceding Monday)
* {{FLOOR(DATE '1903-01-01' TO ISOYEAR)}} should return {{DATE '1903-12-31'}}
(because 1903-01-01 is a Thursday)
> In Avatica DateTimeUtils, add support for FLOOR and CEIL to ISOYEAR
> -------------------------------------------------------------------
>
> Key: CALCITE-5369
> URL: https://issues.apache.org/jira/browse/CALCITE-5369
> Project: Calcite
> Issue Type: Bug
> Components: avatica
> Reporter: Julian Hyde
> Priority: Major
> Fix For: avatica-1.23.0
>
>
> In Avatica DateTimeUtils, add support for computing the FLOOR and CEIL of a
> date to ISOYEAR.
> For example:
> * {{FLOOR(DATE '1900-01-01' TO ISOYEAR)}} should return {{DATE '1900-01-01'}}
> (because 1900-01-01 is a Monday and an ISO year starts on a Monday)
> * {{FLOOR(DATE '1901-01-01' TO ISOYEAR)}} should return {{DATE '1900-12-31'}}
> (because 1901-01-01 is a Tuesday and 1900-12-31 is the preceding Monday)
> * {{FLOOR(DATE '1903-01-01' TO ISOYEAR)}} should return {{DATE '1902-12-29'}}
> (because 1903-01-01 is a Thursday and 1902-12-29 is the nearest Monday)
> * {{FLOOR(DATE '1904-01-01' TO ISOYEAR)}} should return {{DATE '1902-12-29'}}
> (because 1904-01-01 is a Friday, 1904-01-04 is start of the next ISO year,
> but 1904-01-01 falls into the previous ISO year)
> * {{FLOOR(DATE '1906-01-01' TO ISOYEAR)}} should return {{DATE '1906-01-01'}}
> (because 1906-01-01 is a Monday, therefore the start of an ISO year)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)