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

Sylvain Lebresne commented on CASSANDRA-7853:
---------------------------------------------

There is one difference in 2.1, and it's that cqlsh uses paging (and by 
default). And for reasons explained in CASSANDRA-6722, we can't accept this 
kind of queris with paging.

Now, I don't think we should disable paging by default in cqlsh just for this. 
We could special case that case in cqlsh, having it disable paging for that 
type of query only (with a message indicating it did so) but I don't know the 
cqlsh code enough to know if that's doable cleanly enough to be worth it. Or we 
could just let users disable paging themselves (the error message is relatively 
clean after all), though I haven't checked if we have a way to disable paging 
in cqlsh currently. [~mishail], [~thobbs]?

> select . . . in . . . order by regression
> -----------------------------------------
>
>                 Key: CASSANDRA-7853
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-7853
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: MAC OSX cqlsh 3.1.8 (DSE 3.2.7) vs cqlsh 5.0.1 
> (Cassandra 2.1rc6)
>            Reporter: Kristine Hahn
>
> Select statement that sorted results in earlier version gives an error in 
> Cassandra 2.1rc6. To reproduce problem:
> {noformat}
> Connected to Test Cluster at 127.0.0.1:9042.
> [cqlsh 5.0.1 | Cassandra 2.1.0-rc6-SNAPSHOT | CQL spec 3.2.0 | Native 
> protocol v3]
> . . .
> cqlsh:test> CREATE TABLE emp (
>         ... empID int,
>         ... deptID int,
>         ... first_name varchar,
>         ... last_name varchar,
>         ... PRIMARY KEY (empID, deptID));
> cqlsh:test> INSERT INTO emp (empID, deptID, first_name, last_name) VALUES 
> (104, 15, 'jane', 'smith');
> cqlsh:test> INSERT INTO emp (empID, deptID, first_name, last_name) VALUES 
> (130, 15, 'sughit', 'singh');
> SELECT * FROM emp WHERE empID IN (130,104) ORDER BY deptID DESC;
> code=2200 [Invalid query] message="Cannot page queries with both ORDER BY and 
> a IN restriction on the partition key; you must either remove the ORDER BY or 
> the IN and sort client side, or disable paging for this query"
> {noformat}
> Using an earlier version:
> {noformat}
> Kris-Hahns-MacBook-Pro:bin krishahn$ ./cqlsh
> Connected to Test Cluster at localhost:9160.
> [cqlsh 3.1.8 | Cassandra 1.2.17.2 | CQL spec 3.0.0 | Thrift protocol 19.36.2]
> . . .
> cqlsh:excelsior> CREATE TABLE emp4 (
>              ... emp int,
>              ... dept int,
>              ... first_name varchar,
>              ... last_name varchar,
>              ... PRIMARY KEY (emp, dept));
> cqlsh:excelsior> INSERT INTO emp4 (emp, dept, first_name, last_name) VALUES 
> (104, 15, 'jane', 'smith');
> cqlsh:excelsior> INSERT INTO emp4 (emp, dept, first_name, last_name) VALUES 
> (130, 15, 'sughit', 'singh');
> cqlsh:excelsior> SELECT * FROM emp4 WHERE emp IN (130,104) ORDER BY dept DESC;
>  emp | dept | first_name | last_name
> -----+------+------------+-----------
>  104 |   15 |       jane |     smith
>  130 |   15 |     sughit |     singh
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to