cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shahryar Sedghi (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-5240) CQL3 has error with Compund row keys when sceondray index involved
Date Mon, 11 Feb 2013 14:45:12 GMT

     [ https://issues.apache.org/jira/browse/CASSANDRA-5240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Shahryar Sedghi updated CASSANDRA-5240:
---------------------------------------

    Description: 
CREATE TABLE  test(
    interval text,
    seq int,
    id int,
    severity int,
    PRIMARY KEY ((interval, seq), id))
    WITH CLUSTERING ORDER BY (id DESC);
--
CREATE INDEX ON test(severity);

insert into test(interval, seq, id , severity) values('t',1, 1, 1);
insert into test(interval, seq, id , severity) values('t',1, 2, 1);
insert into test(interval, seq, id , severity) values('t',1, 3, 2);
insert into test(interval, seq, id , severity) values('t',1, 4, 3);
insert into test(interval, seq, id , severity) values('t',2, 1, 3);
insert into test(interval, seq, id , severity) values('t',2, 2, 3);
insert into test(interval, seq, id , severity) values('t',2, 3, 1);
insert into test(interval, seq, id , severity) values('t',2, 4, 2);

select * from test where severity = 3 and  interval = 't' and seq =1;

Bad Request: Start key sorts after end key. This is not allowed; you probably should not specify
end key at all under random partitioner


The following works fine

CREATE TABLE  test(
    interval text,
    id int,
    severity int,
    PRIMARY KEY (interval, id))
    WITH CLUSTERING ORDER BY (id DESC);
--
CREATE INDEX ON test(severity);

insert into test(interval, id , severity) values('t1', 4, 1);
insert into test(interval, id , severity) values('t1', 1, 3);
insert into test(interval, id , severity) values('t1', 2, 2);
insert into test(interval, id , severity) values('t1', 3, 3);
insert into test(interval, id , severity) values('t2', 3, 3);
 insert into test(interval, id , severity) values('t2', 1, 3);
 insert into test(interval, id , severity) values('t2', 2, 1);

select * from test where severity = 3 and  interval = 't1';
interval | id | severity
----------+----+----------
       t1 |  3 |        3
       t1 |  1 |        3




  was:
CREATE TABLE  test(
    interval text,
    seq int,
    id int,
    severity int,
    PRIMARY KEY ((interval, seq), id))
    WITH CLUSTERING ORDER BY (id DESC);

insert into test(interval, seq, id , severity) values('t',1, 1, 1);
insert into test(interval, seq, id , severity) values('t',1, 2, 1);
insert into test(interval, seq, id , severity) values('t',1, 3, 2);
insert into test(interval, seq, id , severity) values('t',1, 4, 3);
insert into test(interval, seq, id , severity) values('t',2, 1, 3);
insert into test(interval, seq, id , severity) values('t',2, 2, 3);
insert into test(interval, seq, id , severity) values('t',2, 3, 1);
insert into test(interval, seq, id , severity) values('t',2, 4, 2);

select * from test where severity = 3 and  interval = 't' and seq =1;

Bad Request: Start key sorts after end key. This is not allowed; you probably should not specify
end key at all under random partitioner


The following works fine

CREATE TABLE  test(
    interval text,
    id int,
    severity int,
    PRIMARY KEY (interval, id))
    WITH CLUSTERING ORDER BY (id DESC);

insert into test(interval, id , severity) values('t1', 4, 1);
insert into test(interval, id , severity) values('t1', 1, 3);
insert into test(interval, id , severity) values('t1', 2, 2);
insert into test(interval, id , severity) values('t1', 3, 3);
insert into test(interval, id , severity) values('t2', 3, 3);
 insert into test(interval, id , severity) values('t2', 1, 3);
 insert into test(interval, id , severity) values('t2', 2, 1);

select * from test where severity = 3 and  interval = 't1';
interval | id | severity
----------+----+----------
       t1 |  3 |        3
       t1 |  1 |        3




    
> CQL3 has error with Compund row keys when sceondray index involved
> ------------------------------------------------------------------
>
>                 Key: CASSANDRA-5240
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-5240
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.2.1
>         Environment: Linux centos 6.3
>            Reporter: Shahryar Sedghi
>            Priority: Blocker
>
> CREATE TABLE  test(
>     interval text,
>     seq int,
>     id int,
>     severity int,
>     PRIMARY KEY ((interval, seq), id))
>     WITH CLUSTERING ORDER BY (id DESC);
> --
> CREATE INDEX ON test(severity);
> insert into test(interval, seq, id , severity) values('t',1, 1, 1);
> insert into test(interval, seq, id , severity) values('t',1, 2, 1);
> insert into test(interval, seq, id , severity) values('t',1, 3, 2);
> insert into test(interval, seq, id , severity) values('t',1, 4, 3);
> insert into test(interval, seq, id , severity) values('t',2, 1, 3);
> insert into test(interval, seq, id , severity) values('t',2, 2, 3);
> insert into test(interval, seq, id , severity) values('t',2, 3, 1);
> insert into test(interval, seq, id , severity) values('t',2, 4, 2);
> select * from test where severity = 3 and  interval = 't' and seq =1;
> Bad Request: Start key sorts after end key. This is not allowed; you probably should
not specify end key at all under random partitioner
> The following works fine
> CREATE TABLE  test(
>     interval text,
>     id int,
>     severity int,
>     PRIMARY KEY (interval, id))
>     WITH CLUSTERING ORDER BY (id DESC);
> --
> CREATE INDEX ON test(severity);
> insert into test(interval, id , severity) values('t1', 4, 1);
> insert into test(interval, id , severity) values('t1', 1, 3);
> insert into test(interval, id , severity) values('t1', 2, 2);
> insert into test(interval, id , severity) values('t1', 3, 3);
> insert into test(interval, id , severity) values('t2', 3, 3);
>  insert into test(interval, id , severity) values('t2', 1, 3);
>  insert into test(interval, id , severity) values('t2', 2, 1);
> select * from test where severity = 3 and  interval = 't1';
> interval | id | severity
> ----------+----+----------
>        t1 |  3 |        3
>        t1 |  1 |        3

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message