While trying to play around with 1.1.1 and secondary indexes I just
noticed something odd in cassandra-cli. Example straight from the README:

--> show Mr. Smith

holger>cassandra-cli
[..]
[default@Users] list users;
Using default limit of 100
Using default column limit of 100
-------------------
RowKey: jsmith
=> (column=first, value=John, timestamp=1339507271651000)
=> (column=last, value=Smith, timestamp=1339507280745000)

1 Row Returned.
Elapsed time: 0 msec(s).

--> Hello Mr. Smith with no age.
--> You should be 64 years old:

[default@Users] set Users[jsmith][age] = long(64);
Value inserted.
Elapsed time: 16 msec(s).

[default@Users] list users;
Using default limit of 100
Using default column limit of 100
-------------------
RowKey: jsmith
=> (column=age, value=64, timestamp=1339513585914000)
=> (column=first, value=John, timestamp=1339507271651000)
=> (column=last, value=Smith, timestamp=1339507280745000)

1 Row Returned.
Elapsed time: 0 msec(s).
[default@Users]

--> That worked, as expected. Exit & restart the cli

holger>cassandra-cli
[..]
[default@Users] list users;
Using default limit of 100
Using default column limit of 100
-------------------
RowKey: jsmith
=> (column=age, value=       @, timestamp=1339513585914000)
=> (column=first, value=John, timestamp=1339507271651000)
=> (column=last, value=Smith, timestamp=1339507280745000)

1 Row Returned.
Elapsed time: 78 msec(s).
[default@Users]

// age=@ you say?

I understand of course that since the default validation class is set to
UTF8 I should have inserted '64' as age and not the long(64) as given in
the README - probably an oversight/bug/typo. The README uses 42 as value,
which results in a * as output. To verify the behaviour I used 64, which
is the ASCII value of @.

What I find more curious is that the cli displays the value in
human-readable form immediately after insertion, yet a new session
displays it in "native" form (as it should). Should it not always display
the value according to the validation class, i.e. show the @ immediately
after insertion?

thanks,
Holger


Reply via email to