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

Benjamin Lerer edited comment on CASSANDRA-19699 at 6/12/24 7:57 AM:
---------------------------------------------------------------------

This behaviour is not a bug. It has been there for 9 years (CASSANDRA-728) and 
if my understanding is correct is an inheritance from Thrift. So, I doubt that 
it is something that we can change without taking the risk of breaking some 
existing code out there.
I believe that the behaviour is correct and returning something different would 
be quite surprising for the user as it will not match any more what was 
requested with the CQL query.


was (Author: blerer):
This behaviour is not a bug. It has been there for 9 years (CASSANDRA-728) and 
if my understanding is correct is an inheritance from Thrift. So, I doubt that 
it is something that we can change without taking the risk of breaking some 
existing code out there.
>From my point of view the behaviour is correct and returning something 
>different would be quite surprising for the user as it will not match any more 
>what was requested with the CQL query.

> Tuple clustering slice queries return non-contiguous results for mixed 
> asc/desc clustering columns.
> ---------------------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-19699
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-19699
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL/Interpreter
>            Reporter: Blake Eggleston
>            Priority: Normal
>
> Given the table:
> {{CREATE TABLE ks.tbl (k int, c1 int, c2 int, v int, PRIMARY KEY (k, c1, c2)) 
> WITH CLUSTERING ORDER BY (c1 ASC, c2 DESC)}}
> (Note the different clustering orders of c1 and c2)
> If you run a slice query with a clustering tuple like:
> {{SELECT * FROM ks.tbl WHERE k=0 AND (c1, c2) >= (2, 3)}}
> C* will return a non contiguous set of rows that would match the following 2 
> queries:
> {{SELECT * FROM ks.tbl WHERE k=0 AND c1=2 AND c2 >=3}}
> {{SELECT * FROM ks.tbl WHERE k=0 AND c1>2.}}
> Whether a query like {{(c1, c2) >= (2, 3)}} makes sense for mixed ASC/DESC 
> clustering columns is debateable, but there is a use case for paging type 
> queries like this, so I’d propose that the tuple slice behavior be changed to 
> simply use the direction of the first clustering column. In other words, 
> {{(c1, c2) >= (2, 3) }}would start at the row where {{c1=2 and c2=3}} and 
> continue iterating forwards, regardless of the direction of subsequent 
> clustering columns.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to