cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sylvain Lebresne (JIRA)" <>
Subject [jira] [Commented] (CASSANDRA-11873) Add duration type
Date Thu, 16 Jun 2016 11:18:05 GMT


Sylvain Lebresne commented on CASSANDRA-11873:

For the record, CQL is not SQL and it's not even close. Artificially forcing ourselves to
reuse something existing in SQL *every single time* we need new syntax is largely pointless.
Anyone trying to use CQL as if it was SQL is going to have a bad surprise, and small syntax
differences is going to be the least of its problem.

Don't get me wrong, CQL has the same _general_ structure than SQL and so informing our choices
with what SQL (and popular SQL databases) is doing and borrowing good ideas is certainly desirable.
But that's only the beginning of the conversation, not the end (even more so when said existing
SQL databases don't even agree between themselves). If we think an existing syntax is not
particular good and we can do better for instance, why we would pick a lesser solution?

And in that particular case, I'm _convinced_ that the syntax currently implemented is better
than what Postgres or Oracle do (I reckon that such statement is partly subjective, but I
still stand by it). Certainly not a lot better, granted, but better because as intuitive as
any of the options but more concise. For that reason, count me as a PMC-binding -1 on *not*
supporting it. That said, I'm not against compromises, so please read below before answering.

bq. Of the formats I've seen here, Postgres native format is the most user friendly

And by "Postgres native format", you mean {{1 year 2 months 3 days 4 hours 5 minutes 6 seconds}}
right? If so (and as mentioned previously), I don't really mind supporting that (I guess for
the sake of making the live of Postgres developer easier, or pleasing those that want to show
off their touch-typing skills). I don't mind it as long as we also support the shorter version
(because, if I don't care about Postgres, why wouldn't I be allowed to abbreviate the units?
It surely is pretty natural).

> Add duration type
> -----------------
>                 Key: CASSANDRA-11873
>                 URL:
>             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

View raw message