cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aaron morton <>
Subject Re: How get is working?
Date Thu, 29 Sep 2011 00:13:46 GMT
You should have gotten an error from the CLI saying it cannot parse hex bytes, because it would
now know that the key you are passing is a utf8 / ascii string to be converted into a bytes.

It's throwing on the 0.8 head, but not in the release. Will try to work out why, anyway it
should do this 

[default@abc] set People[wking][name]='ala';          
org.apache.cassandra.db.marshal.MarshalException: cannot parse 'wking' as hex bytes

If you add a key validation class the CLI will know what to do, try this…

create column family People2
    with comparator=UTF8Type
    and key_validation_class = UTF8Type 
    and default_validation_class=UTF8Type;

[default@abc] list People2;
Using default limit of 100
RowKey: jking
=> (column=name, value=aaaaaala, timestamp=1317255173285000)
=> (column=sname, value=saaaaaala, timestamp=1317255173854000)
RowKey: wking
=> (column=name, value=ala, timestamp=1317255173281000)
=> (column=sname, value=sala, timestamp=1317255173283000)

2 Rows Returned.

Hope that helps. 

Aaron Morton
Freelance Cassandra Developer

On 29/09/2011, at 6:12 AM, Julio Julio wrote:

> Hi everyone!
> I'm new user of Cassandra (I'm using Cassandra 0.8.6) 
> and I created CF by command:
> create column family People with comparator=UTF8Type and
> default_validation_class=UTF8Type;
> and then I inserted some values like:
> set People[wking][name]='ala';
> set People[wking][sname]='sala';
> set People[jking][name]='aaaaaala';
> set People[jking][sname]='saaaaaala';
> and now when i'm adding column to for example 'wking' like:
> set People[wking][age]=long(55);
> it's also added to 'jking'. What I'm doing wrong? 
> Also it surprised me when I wrote:
> get People[akingl]; 
> I get some columns although I haven't inserted anything with 
> key like this.
> Can anyone explain why this happening?
> Best regards
> julio

View raw message