cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tyler Hobbs (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-6875) CQL3: select multiple CQL rows in a single partition using IN
Date Wed, 30 Apr 2014 22:41:14 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-6875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13986178#comment-13986178
] 

Tyler Hobbs commented on CASSANDRA-6875:
----------------------------------------

bq. It bothers me to start adding unit tests for CQL queries when all of our CQL tests are
currently in dtest. I'd much rather keep it all in the dtests to avoid the confusion on where
is what tested.

I went with unit tests for a couple of reasons.  The main one is that we can't use prepared
statements with the dtests right now (as far as I can tell).  The other is that it's a lot
faster to work with unit tests than dtests here, and a distributed setup isn't really required
for any of these tests.  We should definitely have a discussion about where and how to test
in general (maybe in a dev ML thread), but my feeling is that dtests are good for:
* Testing end-to-end
* Tests that require more than one node

Otherwise, if it's reasonable to do in a unit test, I don't see why we wouldn't do it there.
 FWIW, if we could use prepared statements in the dtests, I would also add some of the prepared
statement test cases from the unit tests there.

All of your other suggestions sound good, thanks!

> CQL3: select multiple CQL rows in a single partition using IN
> -------------------------------------------------------------
>
>                 Key: CASSANDRA-6875
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6875
>             Project: Cassandra
>          Issue Type: Bug
>          Components: API
>            Reporter: Nicolas Favre-Felix
>            Assignee: Tyler Hobbs
>            Priority: Minor
>             Fix For: 2.0.8
>
>
> In the spirit of CASSANDRA-4851 and to bring CQL to parity with Thrift, it is important
to support reading several distinct CQL rows from a given partition using a distinct set of
"coordinates" for these rows within the partition.
> CASSANDRA-4851 introduced a range scan over the multi-dimensional space of clustering
keys. We also need to support a "multi-get" of CQL rows, potentially using the "IN" keyword
to define a set of clustering keys to fetch at once.
> (reusing the same example\:)
> Consider the following table:
> {code}
> CREATE TABLE test (
>   k int,
>   c1 int,
>   c2 int,
>   PRIMARY KEY (k, c1, c2)
> );
> {code}
> with the following data:
> {code}
>  k | c1 | c2
> ---+----+----
>  0 |  0 |  0
>  0 |  0 |  1
>  0 |  1 |  0
>  0 |  1 |  1
> {code}
> We can fetch a single row or a range of rows, but not a set of them:
> {code}
> > SELECT * FROM test WHERE k = 0 AND (c1, c2) IN ((0, 0), (1,1)) ;
> Bad Request: line 1:54 missing EOF at ','
> {code}
> Supporting this syntax would return:
> {code}
>  k | c1 | c2
> ---+----+----
>  0 |  0 |  0
>  0 |  1 |  1
> {code}
> Being able to fetch these two CQL rows in a single read is important to maintain partition-level
isolation.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message