Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 70A21D110 for ; Thu, 16 Aug 2012 22:29:48 +0000 (UTC) Received: (qmail 87458 invoked by uid 500); 16 Aug 2012 22:29:46 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 87419 invoked by uid 500); 16 Aug 2012 22:29:46 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 87411 invoked by uid 99); 16 Aug 2012 22:29:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2012 22:29:46 +0000 X-ASF-Spam-Status: No, hits=0.0 required=5.0 tests=FSL_RCVD_USER,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [208.113.200.5] (HELO homiemail-a94.g.dreamhost.com) (208.113.200.5) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 16 Aug 2012 22:29:41 +0000 Received: from homiemail-a94.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a94.g.dreamhost.com (Postfix) with ESMTP id 2D8CD38A05C for ; Thu, 16 Aug 2012 15:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=thelastpickle.com; h= content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; s= thelastpickle.com; bh=rL3tr5xFMRFz0fv2Hk7MkvX6Nyg=; b=xZTtJ2yjqN 5e/romrqZRyB5Rnm10Auh1+FGbSd2d7MmW4rQP25AhQ+FGGaZtbJjXcg/jJBgNZc 2ZMb6eNOHO9iyxSJkk2P9d/IrlBPYz205IrwX4HErnVy4It3ebJABIJMebT5Oi21 y+NszD2w8vXdYck4hrpX9AT3KdWEDDetg= Received: from [192.168.2.77] (unknown [116.90.132.105]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aaron@thelastpickle.com) by homiemail-a94.g.dreamhost.com (Postfix) with ESMTPSA id C5B2A38A05B for ; Thu, 16 Aug 2012 15:29:19 -0700 (PDT) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.0 \(1485\)) Subject: Re: wild card on query From: aaron morton In-Reply-To: <1345120743.46368.YahooMailNeo@web110004.mail.gq1.yahoo.com> Date: Fri, 17 Aug 2012 10:29:17 +1200 Content-Transfer-Encoding: quoted-printable Message-Id: <8F4DD79D-A568-41D2-BD43-65187D76A9DF@thelastpickle.com> References: <23567064.830185.1344886189142.JavaMail.nabble@jim.nabble.com> <1BD5A31B-D2BE-4B12-8E8E-44809CA84CB7@thelastpickle.com> <1344944934.97850.YahooMailNeo@web110009.mail.gq1.yahoo.com> <44D433EA-04F3-42F1-98D0-67A584BF5010@thelastpickle.com> <1345024599.5113.YahooMailNeo@web110001.mail.gq1.yahoo.com> <1345120743.46368.YahooMailNeo@web110004.mail.gq1.yahoo.com> To: user@cassandra.apache.org X-Mailer: Apple Mail (2.1485) X-Virus-Checked: Checked by ClamAV on apache.org > 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.=20 Say a CF called ProjectPhotos * row key is the project_id * column name is * column value is image_url or JSON data about the image.=20 You would then slice some columns from one row in the ProjectPhotos CF.=20= You then need to know what images a user has uploaded, with say the = UserPhotos CF.=20 * row key is user_id * column name is timestamp * column value is image_url or JSON data about the image.=20 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.=20 ----------------- Aaron Morton Freelance Developer @aaronmorton http://www.thelastpickle.com On 17/08/2012, at 12:39 AM, Swathi Vikas wrote: > Hi, >=20 > I am trying to run query on cassandra cluster with predicate on row = key. >=20 > 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.=20 >=20 > 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? >=20 > Any sugesstion will help.=20 >=20 > Thank you, > swat.vikas >>>=20 >>>=20 >>=20 >>=20 >>=20 >=20 >=20 >=20