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

Danny Chen commented on CALCITE-3412:
-------------------------------------

I didn't find any engine to support 'FLOOR(... TO XXX)' [1][2], this is the 
grammar i found in SQL standard 2011:

{code:sql}
<floor function> ::=
FLOOR <left paren> <numeric value expression> <right paren>

<numeric value expression> ::=
<term>
| <numeric value expression> <plus sign> <term>
| <numeric value expression> <minus sign> <term>
{code}


[1] https://docs.oracle.com/cd/B19306_01/server.102/b14200/functions058.htm
[2] 
https://docs.microsoft.com/en-us/sql/t-sql/functions/floor-transact-sql?view=sql-server-ver15

> Response Error for FLOOR TIMESTAMP TO WEEK 
> -------------------------------------------
>
>                 Key: CALCITE-3412
>                 URL: https://issues.apache.org/jira/browse/CALCITE-3412
>             Project: Calcite
>          Issue Type: Bug
>          Components: core
>         Environment: mac,linux
>            Reporter: huaicui
>            Priority: Major
>         Attachments: image-2019-10-15-13-33-34-896.png
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Floor timestamp to week exist error:
> The start day of the week is not Sunday or Monday, calcite use Thursday to 
> split a week.
> Example:
> sql: select FLOOR(CAST('2017-01-28' AS TIMESTAMP) TO WEEK);
> Response:
> 2017-01-26 00:00:00.0
>  
> 2017-01-26 is Tuesday that is not our expect result. As result, 2017-01-22 is 
> the first day that we expect.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to