Cassandra cqlsh browser queries possible only in bytes

cassandranosql

I am using Cassandra database through cqlsh client on Linux. I can make only queries with values given as bytes, but I would like to search with the client like in SQL where everything is Strings.

Should I use assume? Still using it I can only change output, but not queries.

Best Answer

I used in my example situation Hector Object Mapping, HOM also for creation of the database from scratch. This was not a good idea, because everything was handled as bytes, like they normally are, and no instructions about how to interpret them was thus given.

Solution to this was to use cqlsh client and give there CQL queries to add tables. So, I made queries like:

CREATE COLUMNFAMILY users (KEY varchar PRIMARY KEY, password varchar);

and with these the remarkable thing is the explicit type (varchar for password) that was given to each column. Now, on the very same tool, data was interpreted as I wanted.

See also:

More info in Getting started with CQL page.

Also see CQL Language Reference for more information e.g. about available datatypes other than varchar mentioned before.