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

Dikang Gu commented on CASSANDRA-14567:
---------------------------------------

My main problem is about the semantics as well.

According to the table schema definition (CLUSTERING ORDER BY (c1 DESC, c2 
ASC)), the rows are sorted by following order on disk:

1, 10, 0, 1

1, 10, 10, 2

1, 1, 0, 3

1, 1, 10, 4

 

For query like "(c1, c2) >= (1, 10) AND (c1, c2) <= (10, 0)", if we interpret 
it to be "fetch all rows between row [1, 10, 0, * ]  and [1, 1, 10, * ]", then 
it should return *all* the rows, which is the behavior in and before 2.2.5. But 
if we interpret the query to be "fetch all rows with (c1 >=1 and c2 >= 10) AND 
(c1 <= 10 and c2 <= 0)", (I have some problems to really understand this), 
which seems to be the behavior after 2.2.5, then it should return one two rows: 
 *[Row[1, 10, 0, 1], Row[1, 1, 10, 4]].*

 

My question is what should be the correct behavior here, and can we somehow 
differentiate these two behaviors, by having two different query grammars? 

 

> CQL query returns different results in 2.2.5 and 3.0.15
> -------------------------------------------------------
>
>                 Key: CASSANDRA-14567
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-14567
>             Project: Cassandra
>          Issue Type: Bug
>          Components: CQL
>            Reporter: Dikang Gu
>            Priority: Major
>
> During our 2.2.5 to 3.0.15 upgrade, we find the a cql query returns different 
> results in 2.2.5 and 3.0.15, here is a unit test to reproduce it, 
> [https://gist.github.com/DikangGu/e538ed2de22b74e49b8dd43f7093a996]
>  
> In C* 2.2.5, it returns all 4 rows: *[Row[1, 10, 0, 1], Row[1, 10, 10, 2], 
> Row[1, 1, 0, 3], Row[1, 1, 10, 4]]*
> While in C* 3.0.15, it only returns 2 rows to client: *[Row[1, 10, 0, 1], 
> Row[1, 1, 10, 4]]*
>   



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to