Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add duration type #2240

Closed
tzach opened this issue Mar 30, 2017 · 7 comments
Closed

Add duration type #2240

tzach opened this issue Mar 30, 2017 · 7 comments

Comments

@tzach
Copy link
Contributor

tzach commented Mar 30, 2017

Cassandra added duration type in 3.10

INSERT INTO RiderResults (rider, race, result) VALUES ('Christopher Froome', 'Tour de France', 89h4m48s);
INSERT INTO RiderResults (rider, race, result) VALUES ('BARDET Romain', 'Tour de France', PT89H8M53S);
INSERT INTO RiderResults (rider, race, result) VALUES ('QUINTANA Nairo', 'Tour de France', P0000-00-00T89:09:09);

https://issues.apache.org/jira/browse/CASSANDRA-13174

@hakuch
Copy link
Contributor

hakuch commented Jul 5, 2017

I've finished porting the underlying Duration type, including its representation, parsing, and pretty-printing.

However, it looks like this feature was introduced in the 3.10 release of Cassandra, so we may want to wait before supporting the new type in CQL.

I could prepare a patch for merging the support for the underlying type and we could revisit this in the future.

Do you have any input, @tzach?

@hakuch
Copy link
Contributor

hakuch commented Jul 5, 2017

For reference, the patch which adds this feature is discussed here.

@avikivity
Copy link
Member

By itself the fact it was added to Cassandra only in 3.10 shouldn't block us.

But it looks like duration can't be represented in cql binary protocol < v5, and we only support v4 so far.

@penberg
Copy link
Contributor

penberg commented Jul 11, 2017

@avikivity CQL protocol v5 is work-in-progress, hidden behind some feature flag in the drivers. We can definitely add support for that in ScyllaDB for the duration type.

avikivity pushed a commit that referenced this issue Jul 13, 2017
Cassandra 3.10 added the `duration` type [1], intended to manipulate date-time
values with offsets (for example, `now() - 2y3h`).

The full implementation of the `duration` type in Scylla requires support
for version 5 of the binary protocol, which is not yet available.

In the meantime, this patch patch adds the implementation of the underlying type
for the eventual `duration` type. Included is also the ported test suite from
the reference implementation and additional tests.

Related to #2240.

[1] https://issues.apache.org/jira/browse/CASSANDRA-11873

Signed-off-by: Jesse Haber-Kucharsky <jhaberku@scylladb.com>
Message-Id: <b1e481da103efee82106bf31f261c5a1f4f8d9ca.1499885803.git.jhaberku@scylladb.com>
@tzach
Copy link
Contributor Author

tzach commented Nov 12, 2017

@hakuch what driver can work with this new type? (and v5)?

@hakuch
Copy link
Contributor

hakuch commented Nov 13, 2017

@tzach, the Datastax Java driver version 3.2.0 appears to support it (as well as additional functionality related to duration that we do not yet support). cqlsh should also support it. I'm not sure about the status of all available drivers, however.

Does that answer your question?

@tzach
Copy link
Contributor Author

tzach commented Nov 23, 2017

Yes it does. Thanks

benipeled pushed a commit to benipeled/scylla that referenced this issue May 31, 2022
…zed bytes context

Resetting the state involves comparing keys. If these are large, they'll
have to be linearized and hence this has to happen in a linearized bytes
context.

Refs: scylladb#2240

Closes scylladb#2241

Upstream: 60f5ec3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants