>From src/java/org/apache/cassandra/db/marshal/CompositeType.java
/*
 * The encoding of a CompositeType column name should be:
 *   <component><component><component> ...
 * where <component> is:
 *   <length of value><value><'end-of-component' byte>
 * where <length of value> is a 2 bytes unsigned short the and the
 * 'end-of-component' byte should always be 0 for actual column name.
 * However, it can set to 1 for query bounds. This allows to query for the
 * equivalent of 'give me the full super-column'. That is, if during a slice
 * query uses:
 *   start = <3><"foo".getBytes()><0>
 *   end   = <3><"foo".getBytes()><1>
 * then he will be sure to get *all* the columns whose first component is "foo".
 * If for a component, the 'end-of-component' is != 0, there should not be any
 * following component. The end-of-component can also be -1 to allow
 * non-inclusive query. For instance:
 *   start = <3><"foo".getBytes()><-1>
 * allows to query everything that is greater than <3><"foo".getBytes()>, but
 * not <3><"foo".getBytes()> itself.
 */

Or am I missing the fact that you are inserting with cql3 as well?

From: Michael Kjellman <mkjell...@barracuda.com<mailto:mkjell...@barracuda.com>>
Reply-To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Date: Wednesday, January 30, 2013 8:03 AM
To: "user@cassandra.apache.org<mailto:user@cassandra.apache.org>" 
<user@cassandra.apache.org<mailto:user@cassandra.apache.org>>
Subject: Re: Inserting via thrift interface to column family created with 
Compound Key via cql3

Did you pack the composite correctly? This exception normally shows up when the 
composite bytes are malformed

On Jan 30, 2013, at 7:45 AM, "Oleksandr Petrov" 
<oleksandr.pet...@gmail.com<mailto:oleksandr.pet...@gmail.com>> wrote:

Yes, execute_cql3_query, exactly.


On Wed, Jan 30, 2013 at 4:37 PM, Michael Kjellman 
<mkjell...@barracuda.com<mailto:mkjell...@barracuda.com>> wrote:
Are you using execute_cql3_query() ?

On Jan 30, 2013, at 7:31 AM, "Oleksandr Petrov" 
<oleksandr.pet...@gmail.com<mailto:oleksandr.pet...@gmail.com>> wrote:

> Hi,
>
> I'm creating a table via cql3 query like:
>
> CREATE TABLE posts (
>   userid text,
>   blog_name text,
>   entry_title text,
>   posted_at text,
>   PRIMARY KEY (userid, blog_name)
> )
>
> After that i'm trying to insert into same column family via thrift interface, 
> and i'm getting following exception: Not enough bytes to read value of 
> component 0
>
>              Cassandra.java:20833 
> org.apache.cassandra.thrift.Cassandra$batch_mutate_result.read
>            TServiceClient.java:78 org.apache.thrift.TServiceClient.receiveBase
>                Cassandra.java:964 
> org.apache.cassandra.thrift.Cassandra$Client.recv_batch_mutate
>                Cassandra.java:950 
> org.apache.cassandra.thrift.Cassandra$Client.batch_mutate
>
> Thrift client doesn't even display that column family when running 
> describe_keyspace.
>
>
> I may be missing something, and I realize that CQL3 is way to, but i'm still 
> oblivious of wether it's even possible to combine cql3 and thrift things.
>
> --
> alex p



--
alex p

Reply via email to