Return-Path: X-Original-To: apmail-cassandra-commits-archive@www.apache.org Delivered-To: apmail-cassandra-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 06738DBFA for ; Wed, 29 Aug 2012 13:45:08 +0000 (UTC) Received: (qmail 95494 invoked by uid 500); 29 Aug 2012 13:45:07 -0000 Delivered-To: apmail-cassandra-commits-archive@cassandra.apache.org Received: (qmail 95471 invoked by uid 500); 29 Aug 2012 13:45:07 -0000 Mailing-List: contact commits-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cassandra.apache.org Delivered-To: mailing list commits@cassandra.apache.org Received: (qmail 95462 invoked by uid 99); 29 Aug 2012 13:45:07 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Aug 2012 13:45:07 +0000 Date: Thu, 30 Aug 2012 00:45:07 +1100 (NCT) From: "basanth gowda (JIRA)" To: commits@cassandra.apache.org Message-ID: <60442252.11774.1346247907833.JavaMail.jiratomcat@arcas> Subject: [jira] [Commented] (CASSANDRA-4532) NPE when trying to select a slice from a composite table MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/CASSANDRA-4532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13444059#comment-13444059 ] basanth gowda commented on CASSANDRA-4532: ------------------------------------------ I was trying to get a slice range, like you could do in thrift. table defn : create tables schedules(status ascii, timecreated bigint, key ascii, nil ascii, PRIMARY KEY(status,timecreated,key)); for the same time there can be a lot of entries. Lets suppose there are 50 entries that match where timecreated is < Ln 1st query : select * from schedules where timecreated <= limit 10; 2nd Query : select * from schedules where timecreated>=L10 AND key=K10 and timecreated NPE when trying to select a slice from a composite table > -------------------------------------------------------- > > Key: CASSANDRA-4532 > URL: https://issues.apache.org/jira/browse/CASSANDRA-4532 > Project: Cassandra > Issue Type: Bug > Components: API, Core > Affects Versions: 1.1.3 > Environment: Cassandra 1.1.3 (2 nodes) on a single host - mac osx > Reporter: basanth gowda > Priority: Minor > Labels: Slice, cql, cql3 > > I posted this question on StackOverflow, because i need a solution. > Created a table with : > {noformat} > create table compositetest(m_id ascii,i_id int,l_id ascii,body ascii, PRIMARY KEY(m_id,i_id,l_id)); > {noformat} > wanted to slice the results returned, so did something like below, not sure if its the right way. The first one returns data perfectly as expected, second one to get the next 3 columns closes the transport of my cqlsh > {noformat} > cqlsh:testkeyspace1> select * from compositetest where i_id<=3 limit 3; > m_id | i_id | l_id | body > ------+------+------+------ > m1 | 1 | l1 | b1 > m1 | 2 | l2 | b2 > m2 | 1 | l1 | b1 > cqlsh:testkeyspace1> Was trying to write something for slice range. > TSocket read 0 bytes > {noformat} > Is there a way to achieve what I am doing here, it would be good if some meaning ful error is sent back, instead of cqlsh closing the transport. > On the server side I see the following error. > {noformat} > ERROR [Thrift:3] 2012-08-12 15:15:24,414 CustomTThreadPoolServer.java (line 204) Error occurred during processing of message. > java.lang.NullPointerException > at org.apache.cassandra.cql3.statements.SelectStatement$Restriction.setBound(SelectStatement.java:1277) > at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.updateRestriction(SelectStatement.java:1151) > at org.apache.cassandra.cql3.statements.SelectStatement$RawStatement.prepare(SelectStatement.java:1001) > at org.apache.cassandra.cql3.QueryProcessor.getStatement(QueryProcessor.java:215) > at org.apache.cassandra.cql3.QueryProcessor.process(QueryProcessor.java:121) > at org.apache.cassandra.thrift.CassandraServer.execute_cql_query(CassandraServer.java:1237) > at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3542) > at org.apache.cassandra.thrift.Cassandra$Processor$execute_cql_query.getResult(Cassandra.java:3530) > at org.apache.thrift.ProcessFunction.process(ProcessFunction.java:32) > at org.apache.thrift.TBaseProcessor.process(TBaseProcessor.java:34) > at org.apache.cassandra.thrift.CustomTThreadPoolServer$WorkerProcess.run(CustomTThreadPoolServer.java:186) > at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) > at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) > at java.lang.Thread.run(Thread.java:680) > {noformat} > With ThriftClient I get : > {noformat} > org.apache.thrift.transport.TTransportException > at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:132) > at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) > at org.apache.thrift.transport.TFramedTransport.readFrame(TFramedTransport.java:129) > at org.apache.thrift.transport.TFramedTransport.read(TFramedTransport.java:101) > at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84) > at org.apache.thrift.protocol.TBinaryProtocol.readAll(TBinaryProtocol.java:378) > at org.apache.thrift.protocol.TBinaryProtocol.readI32(TBinaryProtocol.java:297) > at org.apache.thrift.protocol.TBinaryProtocol.readMessageBegin(TBinaryProtocol.java:204) > at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:69) > at org.apache.cassandra.thrift.Cassandra$Client.recv_execute_cql_query(Cassandra.java:1402) > at org.apache.cassandra.thrift.Cassandra$Client.execute_cql_query(Cassandra.java:1388) > {noformat} -- 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