cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amit Handa <amithand...@gmail.com>
Subject help required to resolve super column family problems
Date Fri, 24 Aug 2012 11:33:59 GMT
hi,
kindly help in resolving the following problem with respect to super column
family.
i am using cassandra version 1.1.3
i created two super families namely "UserMovies" and "movieSimilarity" in
cassandra using cassandra-cli:
*create column family movieSimilarity with column_type = 'Super'
and key_validation_class = UTF8Type
and subcomparator = UTF8Type
and default_validation_class = UTF8Type
and column_metadata = [{
    column_name: Movie, validation_class: UTF8Type},
    {column_name: peermovie, validation_class:UTF8Type},
    {column_name: similarity, validation_class: UTF8Type}];*

*create column family UserMovies with column_type = 'Super'
and key_validation_class = UTF8Type
and subcomparator = UTF8Type
and default_validation_class = UTF8Type
and column_metadata = [{
    column_name: userid, validation_class: UTF8Type},
    {column_name: movie, validation_class:UTF8Type},
    {column_name: rating, validation_class: UTF8Type}];*

I am facing two problems with it:

1) how to manually add data into it using cassandra-cli. i tried this type,
but got the error:
         set UserMovies['user1']['userid'] = 'USER-1';
but got error message: *Column family movieconsumed may only contain
SuperColumns*
(i want to add following data in cf: *UserMovies*
USER-1(userid) -- MOVIEABCD (movie) -- 9 (rating)
and following data in cf: *movieSimilarity*

MOVIEABCD(movie) --- MOVIEEFGH(peermovie) --- 0.88 (similarity)


2) as i want to make query to fetch peer movies name for particular
UserMovie(column name movie) for user(userid: user-1).
How i can perform this query using Hector api (from two super column
families UserMovies and movieSimilarity).

With Regards,
Amit

Mime
View raw message