cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ashot Golovenko (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CASSANDRA-6220) Unable to select multiple entries using In clause on clustering part of compound key
Date Sun, 20 Oct 2013 20:06:43 GMT

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

Ashot Golovenko updated CASSANDRA-6220:
---------------------------------------

    Description: 
I have the following table:

CREATE TABLE rating (
    id bigint,
    mid int,
    hid int,
    r double,
    PRIMARY KEY ((id, mid), hid));

And I get really really strange result sets on the following queries:

cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid = 201329320;

 hid       | r
-----------+--------
 201329320 | 45.476

(1 rows)

cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid = 201329220;

 hid       | r
-----------+-------
 201329220 | 53.62

(1 rows)

cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid in (201329320,
201329220);

 hid       | r
-----------+--------
 201329320 | 45.476

(1 rows)  <-- WRONG - should be two records

As you can see although both records exist I'm not able the fetch all of them using in clause.
By now I have to cycle my requests which are about 30 and I find it highly inefficient given
that I query physically the same row. 

Ideally I'd like the following select to work:
SELECT hid, r FROM rating WHERE id  = 755349113 and mid in ? and hid in ?;
Which doesn't work either.



  was:
I have the following table:

CREATE TABLE rating (
    id bigint,
    mid int,
    hid int,
    r double,
    PRIMARY KEY ((id, mid), hid));

And I get really really strange result sets on the following queries:

cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid = 201329320;

 hid       | r
-----------+--------
 201329320 | 45.476

(1 rows)

cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid = 201329220;

 hid       | r
-----------+-------
 201329220 | 53.62

(1 rows)

cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid in (201329320,
201329220);

 hid       | r
-----------+--------
 201329320 | 45.476  <-- WRONG - only one result

As you can see although both records exist I'm not able the fetch all of them using in clause.
By now I have to cycle my requests which are about 30 and I find it highly inefficient given
that I query physically the same row. 

Ideally I'd like the following select to work:
SELECT hid, r FROM rating WHERE id  = 755349113 and mid in ? and hid in ?;
Which doesn't work either.




> Unable to select multiple entries using In clause on clustering part of compound key
> ------------------------------------------------------------------------------------
>
>                 Key: CASSANDRA-6220
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6220
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Core
>            Reporter: Ashot Golovenko
>
> I have the following table:
> CREATE TABLE rating (
>     id bigint,
>     mid int,
>     hid int,
>     r double,
>     PRIMARY KEY ((id, mid), hid));
> And I get really really strange result sets on the following queries:
> cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid
= 201329320;
>  hid       | r
> -----------+--------
>  201329320 | 45.476
> (1 rows)
> cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid
= 201329220;
>  hid       | r
> -----------+-------
>  201329220 | 53.62
> (1 rows)
> cqlsh:bm> SELECT hid, r FROM rating WHERE id  = 755349113 and mid = 201310 and hid
in (201329320, 201329220);
>  hid       | r
> -----------+--------
>  201329320 | 45.476
> (1 rows)  <-- WRONG - should be two records
> As you can see although both records exist I'm not able the fetch all of them using in
clause. By now I have to cycle my requests which are about 30 and I find it highly inefficient
given that I query physically the same row. 
> Ideally I'd like the following select to work:
> SELECT hid, r FROM rating WHERE id  = 755349113 and mid in ? and hid in ?;
> Which doesn't work either.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Mime
View raw message