[
https://issues.apache.org/jira/browse/CASSANDRA-11873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331333#comment-15331333
]
Benjamin Lerer commented on CASSANDRA-11873:
--------------------------------------------
I am not sure of what {{date1}} and {{date2}} would be as Cassandra do not
support column identifiers at this place in the {{WHERE}} clause but otherwise
the query will be:
{code}
WHERE T >= (NOW() - 1d) + (date1 - date2);
{code}
which seems much more readable to me.
One problem with your proposal is the {{timeunit}} parameter. Functions only
accept arguments associated with a CQL type to be able to deserialize the input.
> Add duration type
> -----------------
>
> Key: CASSANDRA-11873
> URL: https://issues.apache.org/jira/browse/CASSANDRA-11873
> Project: Cassandra
> Issue Type: Improvement
> Components: CQL
> Reporter: Benjamin Lerer
> Assignee: Benjamin Lerer
> Labels: client-impacting, doc-impacting
> Fix For: 3.x
>
>
> For CASSANDRA-11871 or to allow queries with {{WHERE}} clause like:
> {{... WHERE reading_time < now() - 2h}}, we need to support some duration
> type.
> In my opinion, it should be represented internally as a number of
> microseconds.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)