Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0C86EF6A6 for ; Tue, 2 Apr 2013 12:38:36 +0000 (UTC) Received: (qmail 56354 invoked by uid 500); 2 Apr 2013 12:38:33 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 55741 invoked by uid 500); 2 Apr 2013 12:38:27 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 55690 invoked by uid 99); 2 Apr 2013 12:38:25 -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 12:38:25 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [192.174.58.134] (HELO XEDGEA.nrel.gov) (192.174.58.134) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Apr 2013 12:38:20 +0000 Received: from XHUBA.nrel.gov (10.20.4.58) by XEDGEA.nrel.gov (192.174.58.134) with Microsoft SMTP Server (TLS) id 8.3.245.1; Tue, 2 Apr 2013 06:37:48 -0600 Received: from MAILBOX2.nrel.gov ([fe80::19a0:6c19:6421:12f]) by XHUBA.nrel.gov ([::1]) with mapi; Tue, 2 Apr 2013 06:37:58 -0600 From: "Hiller, Dean" To: "user@cassandra.apache.org" Date: Tue, 2 Apr 2013 06:37:57 -0600 Subject: Re: Unable to prefix in astyanax read query Thread-Topic: Unable to prefix in astyanax read query Thread-Index: Ac4vnucx4BThQ1e7ScGN/aSPpU3yIA== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.3.2.130206 acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org We ran into some similar errors in playorm development. Basically, you defined a composite probably but are not correctly using that composite. I am not sure about queries though as we had the issue when saving data (ie. Using deviceID+deviceName did not work and we had to create an full blown composite object). I think you need to read up on how astyanax works with composites=8A..I am not sure this is a cassandra question really=8A.more of an astyanax one. Dean On 4/1/13 11:48 PM, "Apurva Jalit" wrote: >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=20 >(TimeStamp,Device ID, Device Name). Through a serializable object that >has=20 >fields for DeviceID, name and a field name (which stores either Device >Owner or=20 >Device Location). I have inserted some records using Astyanax. > >As per my understanding, the columns for a row are created by combining >Device=20 >ID, Device Name and field name as column name and the value to be the >value for=20 >that particular field. Thus for a particular timestamp and device, the >column=20 >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=20 >particular time-device combination. > >I am using the following query to obtain the results: > > RowSliceQuery query =3D 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=3Dlocalhost(127.0.0.1):9160, latency=3D6(6), >attempts=3D1]InvalidRequestException(why:Not enough bytes to read value of >component 0) > >Can any one help to understand where am I going wrong? > >