Return-Path: X-Original-To: apmail-cassandra-client-dev-archive@minotaur.apache.org Delivered-To: apmail-cassandra-client-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D367CF10B for ; Tue, 2 Apr 2013 14:11:38 +0000 (UTC) Received: (qmail 90733 invoked by uid 500); 2 Apr 2013 14:11:38 -0000 Delivered-To: apmail-cassandra-client-dev-archive@cassandra.apache.org Received: (qmail 90536 invoked by uid 500); 2 Apr 2013 14:11:34 -0000 Mailing-List: contact client-dev-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: client-dev@cassandra.apache.org Delivered-To: mailing list client-dev@cassandra.apache.org Received: (qmail 90500 invoked by uid 99); 2 Apr 2013 14:11:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 14:11:33 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of pushkar.prasad@airtightnetworks.net designates 64.78.61.187 as permitted sender) Received: from [64.78.61.187] (HELO mail21.intermedia.net) (64.78.61.187) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 14:11:26 +0000 Received: from airtightnetworks.net (unknown [115.113.149.71]) (Authenticated sender: smtp@airtightnetworks.net) by mail21.intermedia.net (Postfix) with ESMTPA id 154831DB7 for ; Tue, 2 Apr 2013 07:11:04 -0700 (PDT) Received: from ([127.0.0.1]) with MailEnable ESMTP; Tue, 2 Apr 2013 19:45:39 +0530 From: "Pushkar Prasad" To: References: In-Reply-To: Subject: Unable to prefix in astyanax read query Date: Tue, 2 Apr 2013 19:41:00 +0530 Message-ID: <36D9E199AAC049EBB661CDABD7D2BB25@pune.wibhu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 Thread-Index: Ac4vZ0vK/3kWZaHUQmm3c6GoD+NB9AABBf7gABAW6IA= X-MimeOLE: Produced By Microsoft MimeOLE V6.1.7600.16385 X-Virus-Checked: Checked by ClamAV on apache.org Hi, This is a Astyanax issue that we've encountered. I have a scheme as follows: TimeStamp Device ID Device Name Device Owner Device location I have created this column family using CQL and defined the primary key as (TimeStamp,Device ID, Device Name). Through a serializable object that has fields for DeviceID, name and a field name (which stores either Device Owner or Device Location). I have inserted some records using Astyanax. As per my understanding, the columns for a row are created by combining Device ID, Device Name and field name as column name and the value to be the value for that particular field. Thus for a particular timestamp and device, the column names would be in the pattern (Device ID:Device Name: ...). So I believe we can use these 2 fields as prefix to obtain all the entries for a particular time-device combination. I am using the following query to obtain the results: RowSliceQuery query = adu.keyspace .prepareQuery(columnFamily) .getKeySlice(timeStamp) .withColumnRange(new RangeBuilder() .setStart(deviceID+deviceName+"_\u00000") .setEnd(deviceID+deviceName+"_\uffff") .setLimit(batch_size) .build()); But on executing the above query I get the following Exception: BadRequestException: [host=localhost(127.0.0.1):9160, latency=6(6), attempts=1]InvalidRequestException(why:Not enough bytes to read value of component 0) Can any one help to understand where am I going wrong?