cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Benjamin Lerer (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-11873) Add duration type
Date Mon, 30 May 2016 08:44:12 GMT


Benjamin Lerer commented on CASSANDRA-11873:


The patch adds a new {{duration}} type which store the duration in {{nanoseconds}} as a signed
64bits integer. Due to that the duration has a minimum of  {{-2 ^63^ ns}} and a maximum of
{{2 ^63^ - 1 ns}} (roughly -292/292 years).

The patch allow durration to be specified as litterals. A duration litterals is integer followed
by a time symbol. The supported symbols are:
* {{d}}: days
* {{h}}: hours
* {{m}}: minutes
* {{s}}: seconds
* {{ms}}: milliseconds
* {{ยตs}}: microseconds
* {{ns}}: nanoseconds

The duration can also be specified as a simple integer. In this case the duration unit used
is {{nanoseconds}}.

As the python driver does not support yet the {{duration}} type. The patch modify the CQLSH
scripts to allow it to work with duration columns.

> Add duration type
> -----------------
>                 Key: CASSANDRA-11873
>                 URL:
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: CQL
>            Reporter: Benjamin Lerer
>            Assignee: Benjamin Lerer
>             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

View raw message