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

Julian Hyde commented on CALCITE-2178:
--------------------------------------

Review comments:
* Any time we add a feature for FLOOR, let's also do it for CEIL. They are 
duals. In the long run, doing it for just FLOOR makes things more complicated.
* Time units are a partial order, not a total order. You cannot roll up weeks 
to months, nor months to weeks. So, comparing TimeUnitHierarchy.ordinal() is 
wrong.
* I don't see the need for TimeUnitHierarchy. There is already 
org.apache.calcite.avatica.util.TimeUnit, which is very similar. It even 
contains details of the roll-up, like the multiplier between a unit and its 
parent unit. Rather than TimeUnitHierarchy, I'd add a method {{static boolean 
canRollUp(TimeUnit, TimeUnit)}}. Perhaps that could get added to Avatica 
eventually.

> Extend expression simplifier to work on datetime FLOOR functions
> ----------------------------------------------------------------
>
>                 Key: CALCITE-2178
>                 URL: https://issues.apache.org/jira/browse/CALCITE-2178
>             Project: Calcite
>          Issue Type: Improvement
>          Components: core
>            Reporter: Jesus Camacho Rodriguez
>            Assignee: Jesus Camacho Rodriguez
>            Priority: Major
>             Fix For: 1.16.0
>
>
> Extend expression simplifier to support:
> {code}
> FLOOR(FLOOR(CAST( '2010-01-10 00:00:00' AS TIMESTAMP) TO HOUR) TO DAY) => 
> FLOOR(CAST( '2010-01-10 00:00:00' AS TIMESTAMP) TO DAY)
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to