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

Benjamin Lerer commented on CASSANDRA-11936:
--------------------------------------------

I created a new branch for trunk and made the fixes to it:

||trunk|[branch|https://github.com/apache/cassandra/compare/trunk...blerer:11936-trunk]|[utests|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-11936-trunk-testall/]|[dtests|http://cassci.datastax.com/view/Dev/view/blerer/job/blerer-11936-trunk-dtest/]|

bq. Do you think it's better skip supporting for simple date + sub-day sums? 
It'll currently throw an exception, although it could've been just an identity 
function on the first arg..

We discussed that subjet off-line and come to the conclusion that it was less 
misleading to reject those type of operations.
If somebody really need to add sub-day duration to a date, he can do: 
{{toTimestamp(myDate) + 2h30m}}

bq. looks like {{to/fromTimeInMillis}} is a bit too specific to be pulled up to 
the temporal, since it's supported by just a single temporal type here we can 
just make it static. Or maybe the semantics/ meaning of their particular method 
is very different from instance to instance.

The  {{to/fromTimeInMillis}} exists in {{SimpleDateType}}, {{TimestampType}} 
and {{TimeuuidType}}. They were simply already existing before.

bq. Just to consider that as an idea, for example, we could also allow 
subtracting date from date and yield duration type as a result. Do you think it 
can be useful?

As the duration type as a lot of limitations, I am not sure of how much useful 
it could be. I would be in favor of waiting to see if somebody really needs it 
before adding it.

> Add support for + and - operations on dates
> -------------------------------------------
>
>                 Key: CASSANDRA-11936
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-11936
>             Project: Cassandra
>          Issue Type: Sub-task
>          Components: CQL
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>             Fix For: 3.x
>
>
> For time series it can be interesting to allow queries with {{WHERE}} clause 
> like: {{... WHERE reading_time < now() - 2h}}
> In order to do that we need to add support for: {{+}} and {{-}} operation 
> with date.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to