when i create table in cassandra 2.0 using phpcassa,i got the error as follows
Fatal error: Uncaught exception 'cassandra\InvalidRequestException' with message 'line 2:25 mismatched input 'map' expecting set null' in /var/www/assignment1/lib/thrift/Thrift.php:574
my code goes as
$raw->client->execute_cql_query("CREATE TABLE
mc_user(mc_user_id uuid primary key ,mc_user_email varchar,mc_user_pwd varchar,mc_status varchar,mc_user_type map<varchar,varchar>)", Compression::NONE);
if it doesnt supports does anyone can give me alternative solution for one to many relation?
Collections are definitely supported in Cassandra since version 1.2 - I don't know PHP Cassa however your statement looks correct so I'd look on the client side for the solution.
An alternative could be using a composite key in which the second part of the key is the key you wanted use in the map
Now instead of having one entry per user with a map, you have many entries per user. I've made the email, password and status static since they should be the same for each mc_user_id (two main advantages comes in my mind: they are not replicated in each row so they won't waste disk space and you can update them easily just with 1 update statement since static columns are accessible only by partition key).
You can still retrieve user's information (now static) only with mc_user_id
You can retrieve a "map" entry with mc_user_id, themapkey
You can also easily rebuild all map with a select *
HTH Cheers, Carlo