Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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.

share|improve this question
    
Please clarify your question with example code of what you're doing. –  Nick Chammas Apr 13 '12 at 17:26
    
This part is not coding, this is reading the database with a specific database command line tool. Mentioned cqlsh is the client where you can type CQL queries. My problem is that everything on that client is shown as bytes, but I would like to work with higher level types. Maybe this post clarifies this: question about cassandra on SO . Look at the answer of that post, it says that every data in Cassandra is byte[] . –  mico Apr 16 '12 at 6:37
add comment

1 Answer

up vote 0 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.