[ https://issues.apache.org/jira/browse/CASSANDRA-11873?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15333327#comment-15333327 ]
Sylvain Lebresne commented on CASSANDRA-11873: ---------------------------------------------- Well, # We're not reinventing the wheel, we're reusing [influxdb syntax|https://docs.influxdata.com/influxdb/v0.13/query_language/data_exploration/#time-syntax-in-queries]. Even besides that, calling a syntax like {{2h3m}} "reinventing the wheel" feels to me a bit of a strech. # If one bothers reading the [linked Postgres page|https://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-INTERVAL-INPUT-EXAMPLES], he'll note that Postgres supports {{P2h3m}} which is pretty damn close (it also supports {{2 hours 3 minutes}} which I don't think is necessary but wouldn't mind supporting as alternative to the shorted version). Surely, Postgres veterans are smart enough to not be thrown off by us dropping the {{P}} at the beginning. # Regarding the Oracle syntax, I think it's terrible. The goal of this ticket is to add a user-friendly syntax for inputing durations, but imo {{now() - (INTERVAL '4 5:12' DAY TO MINUTE)}} (to mean {{now() - 4d5h12m}}) is verbose, unintuitive and plain ugly. And as far as I can tell, it's nowhere near standard (Postgres don't seem to support it for instance). So I'm basically a strong PMC binding -1 on it. Overall, we're not "Making up completely new syntax". {{3h2m5s}} is pretty standard (as in, in life in general) and concise, and it's even supported by some other database (influxdb and, up to a minor detail, Postgres). And I don't see any other syntax being a de-factor standard in other databases. > 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)