[jira] [Created] (CASSANDRA-6502) Caused by: InvalidRequestException(why:Invalid restrictions)
Akshay DM created CASSANDRA-6502: Summary: Caused by: InvalidRequestException(why:Invalid restrictions) Key: CASSANDRA-6502 URL: https://issues.apache.org/jira/browse/CASSANDRA-6502 Project: Cassandra Issue Type: Bug Components: API, Core, Hadoop Environment: CentOS release 6.4 Reporter: Akshay DM I am using Cassandra 1.2.10 and have a primary key column which is of timestamp datatype. Now I am trying to retrieve the data for the date ranges. Since we know we can't use between clause, we are using greater than() and less than() to get the date ranges. This perfectly seems to work in cassandra's cqlsh. But with pig_cassandra integration, it throws an error. Here is the load function. {quote} filteredData = LOAD 'cql://keyspace/columnfamily?where_clause=time1%3E1357054841000590+and+time1%3C1357121822000430' USING org.apache.cassandra.hadoop.pig.CqlStorage(); {quote} Here is the error it throws.. {quote} 2013-12-18 04:32:51,196 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Unable to recreate exception from backed error: java.lang.RuntimeException at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:651) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.computeNext(CqlPagingRecordReader.java:352) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.computeNext(CqlPagingRecordReader.java:275) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader.getProgress(CqlPagingRecordReader.java:181) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigRecordReader.getProgress(PigRecordReader.java:169) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.getProgress(MapTask.java:514) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:539) at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) at org.apache.hadoop.mapred.Child.main(Child.java:249) Caused by: InvalidRequestException(why:Invalid restrictions found on time1) at org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:39567) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) at org.apache.cassandra.thrift.Cassandra$Client.recv_prepare_cql3_query(Cassandra.java:1625) at org.apache.cassandra.thrift.Cassandra$Client.prepare_cql3_query(Cassandra.java:1611) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.prepareQuery(CqlPagingRecordReader.java:591) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:621) ... 17 more {quote} -- This message was sent by Atlassian JIRA (v6.1.4#6159)
[jira] [Updated] (CASSANDRA-6502) Caused by: InvalidRequestException(why:Invalid restrictions)
[ https://issues.apache.org/jira/browse/CASSANDRA-6502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Akshay DM updated CASSANDRA-6502: - Reviewer: Alex Liu Caused by: InvalidRequestException(why:Invalid restrictions) Key: CASSANDRA-6502 URL: https://issues.apache.org/jira/browse/CASSANDRA-6502 Project: Cassandra Issue Type: Bug Components: API, Core, Hadoop Environment: CentOS release 6.4 Reporter: Akshay DM I am using Cassandra 1.2.10 and have a primary key column which is of timestamp datatype. Now I am trying to retrieve the data for the date ranges. Since we know we can't use between clause, we are using greater than() and less than() to get the date ranges. This perfectly seems to work in cassandra's cqlsh. But with pig_cassandra integration, it throws an error. Here is the load function. {quote} filteredData = LOAD 'cql://keyspace/columnfamily?where_clause=time1%3E1357054841000590+and+time1%3C1357121822000430' USING org.apache.cassandra.hadoop.pig.CqlStorage(); {quote} Here is the error it throws.. {quote} 2013-12-18 04:32:51,196 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Unable to recreate exception from backed error: java.lang.RuntimeException at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:651) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.computeNext(CqlPagingRecordReader.java:352) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.computeNext(CqlPagingRecordReader.java:275) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader.getProgress(CqlPagingRecordReader.java:181) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigRecordReader.getProgress(PigRecordReader.java:169) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.getProgress(MapTask.java:514) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:539) at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) at org.apache.hadoop.mapred.Child.main(Child.java:249) Caused by: InvalidRequestException(why:Invalid restrictions found on time1) at org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:39567) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) at org.apache.cassandra.thrift.Cassandra$Client.recv_prepare_cql3_query(Cassandra.java:1625) at org.apache.cassandra.thrift.Cassandra$Client.prepare_cql3_query(Cassandra.java:1611) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.prepareQuery(CqlPagingRecordReader.java:591) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:621) ... 17 more {quote} -- This message was sent by Atlassian JIRA (v6.1.4#6159)
[jira] [Updated] (CASSANDRA-6502) Caused by: InvalidRequestException(why:Invalid restrictions)
[ https://issues.apache.org/jira/browse/CASSANDRA-6502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Akshay DM updated CASSANDRA-6502: - Reviewer: (was: Alex Liu) Caused by: InvalidRequestException(why:Invalid restrictions) Key: CASSANDRA-6502 URL: https://issues.apache.org/jira/browse/CASSANDRA-6502 Project: Cassandra Issue Type: Bug Components: API, Core, Hadoop Environment: CentOS release 6.4 Reporter: Akshay DM I am using Cassandra 1.2.10 and have a primary key column which is of timestamp datatype. Now I am trying to retrieve the data for the date ranges. Since we know we can't use between clause, we are using greater than() and less than() to get the date ranges. This perfectly seems to work in cassandra's cqlsh. But with pig_cassandra integration, it throws an error. Here is the load function. {quote} filteredData = LOAD 'cql://keyspace/columnfamily?where_clause=time1%3E1357054841000590+and+time1%3C1357121822000430' USING org.apache.cassandra.hadoop.pig.CqlStorage(); {quote} Here is the error it throws.. {quote} 2013-12-18 04:32:51,196 [main] ERROR org.apache.pig.tools.grunt.Grunt - ERROR 2997: Unable to recreate exception from backed error: java.lang.RuntimeException at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:651) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.computeNext(CqlPagingRecordReader.java:352) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.computeNext(CqlPagingRecordReader.java:275) at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143) at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader.getProgress(CqlPagingRecordReader.java:181) at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigRecordReader.getProgress(PigRecordReader.java:169) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.getProgress(MapTask.java:514) at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.nextKeyValue(MapTask.java:539) at org.apache.hadoop.mapreduce.MapContext.nextKeyValue(MapContext.java:67) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:143) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:396) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) at org.apache.hadoop.mapred.Child.main(Child.java:249) Caused by: InvalidRequestException(why:Invalid restrictions found on time1) at org.apache.cassandra.thrift.Cassandra$prepare_cql3_query_result.read(Cassandra.java:39567) at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:78) at org.apache.cassandra.thrift.Cassandra$Client.recv_prepare_cql3_query(Cassandra.java:1625) at org.apache.cassandra.thrift.Cassandra$Client.prepare_cql3_query(Cassandra.java:1611) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.prepareQuery(CqlPagingRecordReader.java:591) at org.apache.cassandra.hadoop.cql3.CqlPagingRecordReader$RowIterator.executeQuery(CqlPagingRecordReader.java:621) ... 17 more {quote} -- This message was sent by Atlassian JIRA (v6.1.4#6159)
[jira] [Commented] (CASSANDRA-6151) CqlPagingRecorderReader Used when Partition Key Is Explicitly Stated
[ https://issues.apache.org/jira/browse/CASSANDRA-6151?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13848964#comment-13848964 ] Akshay DM commented on CASSANDRA-6151: -- @Shridhar The patch seems to be working for 1.2.12 too. Thanks a lot... 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, 6151-v3-1.2-branch.txt, 6151-v4-1.2.10-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 maptext, 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. h3. Solution If it have EQUAL clauses for all the partitioning keys, we use Query {code} SELECT * FROM data WHERE occurday='A Great Day' AND seqnumber=1 LIMIT 1000 ALLOW FILTERING {code} instead of {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} The base line implementation is to retrieve all data of all rows around the ring. This new feature is to retrieve all data of a wide row. It's a one level lower than the base line. It helps for the use case where user is only interested in a specific wide row, so the user doesn't spend whole job to retrieve all the rows around the ring. -- This message was sent by Atlassian JIRA (v6.1.4#6159)