> I want to retrieve all the photos from all the users of certain project. My 
> sql like query will be "select projectid * photos from Users". How can i run 
> this kind of row key predicate while executing query on cassandra?
You cannot / should not do that using the data model you have. (i.e. you could 
do it with a secondary index, but in this case you probably should not).

Try to de-normalise your data. 

Say a CF called ProjectPhotos

* row key is the project_id
* column name is <timestamp:user_id>
* column value is image_url or JSON data about the image. 

You would then slice some columns from one row in the  ProjectPhotos CF. 

You then need to know what images a user has uploaded, with say the UserPhotos 
CF. 

* row key is user_id
* column name is timestamp
* column value is image_url or JSON data about the image. 

I did a twitter sample app at http://wdcnz.com a couple of weeks ago that shows 
denormalising data  https://github.com/amorton/wdcnz-2012-site and 
http://www.slideshare.net/aaronmorton/hellow-world-cassandra

Hope that helps. 

-----------------
Aaron Morton
Freelance Developer
@aaronmorton
http://www.thelastpickle.com

On 17/08/2012, at 12:39 AM, Swathi Vikas <swat.vi...@yahoo.com> wrote:

> Hi,
> 
> I am trying to run query on cassandra cluster with predicate on row key.
> 
> I have column family called "Users" and rows with row key like 
> "projectid_userid_photos". Each user within a project can have rows like 
> projectid_userid_blog, projectid_userid_status and so on. 
> 
> I want to retrieve all the photos from all the users of certain project. My 
> sql like query will be "select projectid * photos from Users". How can i run 
> this kind of row key predicate while executing query on cassandra?
> 
> Any sugesstion will help. 
> 
> Thank you,
> swat.vikas
>>> 
>>> 
>> 
>> 
>> 
> 
> 
> 

Reply via email to