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

Alex Liu commented on CASSANDRA-6151:
-------------------------------------

v2 patch set default CL to ONE. My unit test is in the patch.

{code}
CREATE KEYSPACE cql3ks WITH replication = {'class': 'SimpleStrategy', 
'replication_factor' : 1}
 CREATE TABLE compositekeytable (key1 text, key2 int, key3 int, key4 int, 
column1 int, column2 float, primary key((key1, key2), key3, key4))
 CREATE INDEX column1 on compositekeytable (column1);
INSERT INTO compositekeytable (key1, key2, key3, key4, column1, column2) values 
('key1', 111, 100, 100, 100, 10.1)
 INSERT INTO compositekeytable (key1, key2, key3, key4, column1, column2) 
values ('key1', 111, 100, 101, 100, 10.1)
 INSERT INTO compositekeytable (key1, key2, key3, key4, column1, column2) 
values ('key1', 111, 100, 102, 100, 10.1)
 INSERT INTO compositekeytable (key1, key2, key3, key4, column1, column2) 
values ('key1', 111, 100, 103, 100, 10.1)
  INSERT INTO compositekeytable (key1, key2, key3, key4, column1, column2) 
values ('key1', 111, 100, 104, 100, 10.1)
 INSERT INTO compositekeytable (key1, key2, key3, key4, column1, column2) 
values ('key1', 111, 100, 105, 100, 10.1)

composite_rows = LOAD 
'cql://cql3ks/compositekeytable?where_clause=key1%20%3D%20%27key1%27%20and%20key2%20%3D%20111%20and%20column1%3D100&page_size=2'
 USING CqlStorage();
dump composite_rows;
 
{code}

Can you check your test settings to mine?

> CqlPagingRecorderReader Used when Partition Key Is Explicitly Stated
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-6151
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-6151
>             Project: Cassandra
>          Issue Type: Bug
>          Components: Hadoop
>            Reporter: Russell Alexander Spitzer
>            Assignee: Alex Liu
>            Priority: Minor
>         Attachments: 6151-1.2-branch.txt, 6151-v2-1.2-branch.txt
>
>
> From 
> http://stackoverflow.com/questions/19189649/composite-key-in-cassandra-with-pig/19211546#19211546
> The user was attempting to load a single partition using a where clause in a 
> pig load statement. 
> CQL Table
> {code}
> CREATE table data (
>   occurday  text,
>   seqnumber int,
>   occurtimems bigint,
>   unique bigint,
>   fields map<text, text>,
>   primary key ((occurday, seqnumber), occurtimems, unique)
> )
> {code}
> Pig Load statement Query
> {code}
> data = LOAD 
> 'cql://ks/data?where_clause=seqnumber%3D10%20AND%20occurday%3D%272013-10-01%27'
>  USING CqlStorage();    
> {code}
> This results in an exception when processed by the the CqlPagingRecordReader 
> which attempts to page this query even though it contains at most one 
> partition key. This leads to an invalid CQL statement. 
> CqlPagingRecordReader Query
> {code}
> SELECT * FROM "data" WHERE token("occurday","seqnumber") > ? AND
> token("occurday","seqnumber") <= ? AND occurday='A Great Day' 
> AND seqnumber=1 LIMIT 1000 ALLOW FILTERING
> {code}
> Exception
> {code}
>  InvalidRequestException(why:occurday cannot be restricted by more than one 
> relation if it includes an Equal)
> {code}
> I'm not sure it is worth the special case but, a modification to not use the 
> paging record reader when the entire partition key is specified would solve 
> this issue. 



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

Reply via email to