[
https://issues.apache.org/jira/browse/CASSANDRA-6875?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13986889#comment-13986889
]
Tyler Hobbs commented on CASSANDRA-6875:
----------------------------------------
After thinking more closely about splitting up SelectStatement into two
subclasses for single-column and multi-column restrictions, I'm not 100%
convinced that's the best path.
For example, suppose you have a query like {{SELECT * FROM foo WHERE key=0 AND
c1 > 0 AND (c1, c2) < (2, 3)}}. We could a) require it to be written like
{{(c1) > (0) AND (c1, c2) < (2, 3)}}, or b) accept that syntax and correctly
reduce the expressions to a single multi-column slice restriction. I'm not
sure that option (b) would be clearer than keeping the restrictions separate.
I can also imagine us supporting something like {{SELECT ... WHERE key=0 AND
c1=0 AND (c2, c3) > (1, 2)}} in the future. Of course, we could also require
this to be written differently ({{(c1, c2, c3) > (0, 1, 2) AND (c1) <= (0)}} or
reduce it to a single multi-column slice restriction. I'm just pointing out
that this may become less clear than simply improving the bounds-building code
(which I agree is needed).
> 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)