[
https://issues.apache.org/jira/browse/CASSANDRA-11873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15329196#comment-15329196
]
Sylvain Lebresne commented on CASSANDRA-11873:
----------------------------------------------
bq. I was wondering if instead of introducing support for specific math
operations and the necessary type conversions, a set of date/time functions
wouldn't work better (and be less error prone)
Could you maybe define "work better", and why do you think operators are error
prone? But I'll also note that adding operators doesn't at all exclude also
adding more specific date/time functions if they make sense. What we're looking
for here is convenience first, and things like {{WHERE t >= now() - 2h}} looks
pretty intuitive to me on that front.
bq. Using functions could potentially be more extensible over time by allowing
to compose these.
Operators *are* functions. And I mean that literally, they will just be
syntactic sugar for native functions internally. They will compose with any
other function in particular.
> 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)