On Mon, Aug 22, 2011 at 1:08 AM, Yan Chunlu <springri...@gmail.com> wrote:

> connect to cassandra-cli and issue the list my cf I got
>
> RowKey: comments_62559
> => (column=76616c7565,
> value=28286c70310a4c3236373632334c0a614c3236373733304c0a614c3236373737304c0a614c3236373932324c0a614c3236373934364c0a614c3236383137314c0a614c3236383330334c0a614c3236383934314c0a614c3236383938394c0,
> timestamp=1312791934150273)
>
>
> and using
> get mycf['comments_62559'] could return
> (column=76616c7565,
> value=28286c70310a4c3236373632334c0a614c3236373733304c0a614c3236373737304c0a614c3236373932324c0a614c3236373934364c0a614c3236383137314c0a614c3236383330334c0a614c3236383934314c0a614c3236383938394c0,
> timestamp=1312791934150273)
>
>
>
> but
> get mycf['comments_62559'][76616c7565];
>
> returns 'Value was not found'
>
> did I do something wrong?
>

Yes/Probably. Based on how you have defined your column families the data
stored in your columns may be displayed differently. By default the storage
is byte []. The Cli makes the decision to convert them to hex strings* (each
major version 0.6. 0.7.X and 0.8.X of c* was selective about what it
converted and why.)

In any case there are two fixes:
1) Update the column family meta data and set the types correctly ASCII,
UTF8, LONG, etc

2) Use the ASSUME keyword in the CLI to convert the rows to readable
displays
& when selecting columns use cli functions like : get
CF[ascii('x')][ascii('y')] to make get what you are actually asking for.

The CLI is more correct in current versions then it was in the past in
regard to types and conversions, but if you do not define CF Meta Data it
makes you scratch your head at times because it is not exactly clear that it
is showing you a hex encoded byte [] and not an ascii string.

Edward

Reply via email to