cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hiller, Dean" <>
Subject Re: Unable to prefix in astyanax read query
Date Tue, 02 Apr 2013 12:37:57 GMT
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Š..I am not sure this is a cassandra question
reallyŠ.more of an astyanax one.


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
>(TimeStamp,Device ID, Device Name). Through a serializable object that
>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
>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
>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<String, ApBaseData> 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(, 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?

View raw message