cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jonathan Ellis <jbel...@gmail.com>
Subject Re: Cassandra 0.8 CLI: Inconsistent treatment of literals for keys/columns and values
Date Tue, 30 Aug 2011 02:57:28 GMT
I answered this earlier today, so I added it to the FAQ:
http://wiki.apache.org/cassandra/FAQ#cli_keys

On Mon, Aug 29, 2011 at 9:31 PM, Oleg Proudnikov <olegp@cloudorange.com> wrote:
> Hi,
>
> After installing Cassandra 0.8 I discovered that my app stopped working. The
> issue is that the app is now unable to read a row that was inserted by a CLI set
> command with a numeric string key.
>
> CLI in Cassandra 0.8 seems to be treating literals inconsistently. Please let me
> know if I am missing something. Here is a very simple scenario:
>
> create column family Ranges;
> set Ranges['1']['1']='1';
> list Ranges;
>
> -------------------
> RowKey: 01
> => (column=01, value=31, timestamp=1314636970671000)
>
> The row key and column '1' are treated as bytes while the value is treated as
> UTF8 or ASCII. This raw can not be read with a string serializer for "1". This
> is clear when I make keys, columns and values readable:
>
> assume Ranges keys as utf8;
> assume Ranges comparator as utf8;
> assume Ranges validator as utf8;
> list Ranges;
>
> -------------------
> RowKey: ☺
> => (column=☺, value=1, timestamp=1314636970671000)
>
>
>
> This issue is even more obscure when I use an IP address as a key. The CLI is
> also unable to deserialize key after the format is specified:
>
> set Ranges['192.168.2.17']['1']='1';
> list Ranges;
>
> -------------------
> RowKey: 19ff16ffff17
> => (column=01, value=31, timestamp=1314637423906000)
>
> assume Ranges keys as utf8;
> list Ranges;
> invalid UTF8 bytes 19ff16ffff17
>
> Thanks you,
> Oleg
>
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Mime
View raw message