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 7AD4874EF for ; Thu, 29 Dec 2011 20:12:40 +0000 (UTC) Received: (qmail 7977 invoked by uid 500); 29 Dec 2011 20:12:38 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 7885 invoked by uid 500); 29 Dec 2011 20:12:38 -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 7877 invoked by uid 99); 29 Dec 2011 20:12:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Dec 2011 20:12:38 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of edlinuxguru@gmail.com designates 209.85.210.172 as permitted sender) Received: from [209.85.210.172] (HELO mail-iy0-f172.google.com) (209.85.210.172) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Dec 2011 20:12:30 +0000 Received: by iabz21 with SMTP id z21so2275380iab.31 for ; Thu, 29 Dec 2011 12:12:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=ei/yz6v9NMPLVO08gFYC89Y0EHhSmnOqBryiH0nw8Zs=; b=qOYDFwtQf1oDOoUKtnmjTN0WjaTyQbvQhwr8fTUCzifJ6k2FDEO1QNcA4/GnpwSdlU /FS8XlWP5ERg8JwcnTjdkPhY8NwCe2aqK/zgBdbcpecies3GxbplP+uiOOw9rb8zUw7D mAzECVQHV55NgN89bbduWDfHd/nzmxAazoWQo= MIME-Version: 1.0 Received: by 10.42.72.135 with SMTP id o7mr39059083icj.45.1325189528987; Thu, 29 Dec 2011 12:12:08 -0800 (PST) Received: by 10.42.166.66 with HTTP; Thu, 29 Dec 2011 12:12:08 -0800 (PST) In-Reply-To: References: Date: Thu, 29 Dec 2011 15:12:08 -0500 Message-ID: Subject: Re: Retrieve all composite columns from a row, whose composite name's first component matches from a list of Integers From: Edward Capriolo To: user@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Hum... Do you have this? scf [b][1][a]=3Dvalue scf [b][1][x]=3Dvalue scf [b][7][b]=3Dvalue and you want to slice: scf [b][1][*] Which would result in scf [b][1][a]=3Dvalue scf [b][1][x]=3Dvalue ? The composite version of this would be: cf [b][1:a]=3Dvalue cf [b][1:x]=3Dvalue cf [b][7:b]=3Dvalue I am not sure exactly what you are doing because A SlicePredicate takes either a list of columns or a SliceRange. A ColumnPath takes a Single SuperColumn. I do not see how this is done with Columns or SuperColumns. Maybe you can provide a code snippet and/or some sample data? On 12/29/11, Aditya wrote: > @Edward: Perhaps you missed to notice that I need to always retrieve 'all > columns' under the supercolumn at any time.. and as per my query > requirements if I use composite columns instead of supercolumns then it i= s > impossible to do wildcard queries like the ones asked in this thread's > headline but which is much easier to do through the use of supercolumns. > > On Thu, Dec 29, 2011 at 11:06 PM, Edward Capriolo > wrote: > >> The use case in question was: Only accessing some columns. >> >> Even if that is not the case: >> >> SuperColumns: 1 extra level of nesting >> Composite Colunns: Arbitrary levels of nesting >> >> SuperColumns: More overhead (space on disk) then using your own delimite= r >> '_' >> SuperColumns: Likely going to be replaced in future c* version behind >> the scenes by composite columns anyway >> SuperColumns: Usually an afterthought for API developers, (support for >> them comes "later") >> SuperColumns: Almost always utilized incorrectly by users, users speak >> of '10%' performance gains after they switch away from them. >> >> There are some (a small % of cases) where SuperColumns are a better >> choice, but this is rare. With composites and concatenating columns >> they have no great purpose any more, (bad analogy coming!) like a >> mechanical type writer. >> >> On 12/29/11, Philippe wrote: >> > Would you stand by that statement in case all colums inside the super >> > column need to be read? Why? >> > >> > Thanks >> > Le 28 d=E9c. 2011 19:26, "Edward Capriolo" a >> =E9crit : >> > >> >> Super columns have the same fundamental problem and perform worse in >> >> general. So switching from composites to super columns is NEVER a goo= d >> >> idea. >> >> >> >> >> >> On Wed, Dec 28, 2011 at 1:19 PM, Aditya wrote: >> >> >> >>> Since I have around 20 items to query, I guess making 20 queries to >> >>> retrieve activities by all followies on all of those 20 columns woul= d >> too >> >>> inefficient, so to take the advantage of more efficient queries, are >> >>> supercolumns recommended for this case ? Anyways, in case I use >> >>> supercolumns, I need to retrieve the entire supercolumn at any point >> >>> of >> >>> time & I am writing subcolumn(s) to the supercolumn at different tim= es >> >>> not >> >>> at once. >> >>> >> >>> On Wed, Dec 28, 2011 at 8:07 PM, Edward Capriolo >> >>> wrote: >> >>> >> >>>> You need to execute one get slice operation for each item id or if >> >>>> the >> >>>> row is not large , you can try one large get slice on the entire ro= w >> and >> >>>> deal with the results client side. >> >>>> >> >>>> If you try method 1 When doing slices on composites you can set the >> >>>> start inclusive or exclusive values to get only the column you want >> and >> >>>> not >> >>>> some extra columns up to slice range size. >> >>>> >> >>>> >> >>>> On Tuesday, December 27, 2011, Aditya wrote: >> >>>> > I need to store data of all activities by user's followies in >> >>>> > single >> >>>> row. I am trying to do that making use of composite column names in= a >> >>>> single user specific row named 'rowX'. >> >>>> > On any activity by a user's followie on an item, a column is stor= ed >> in >> >>>> 'rowX'. The column has a composite type column name made up of >> >>>> itemId+userId (which makes it unique col. name) in rowX. (& column >> value >> >>>> contains the activity data related to that item by that followie) >> >>>> > >> >>>> > Now I want to retrieve activity by all users on a list of items. = So >> I >> >>>> need to retrieve all composite columns with composite's first >> component >> >>>> matching the itemId. Is it possible to do such a query to Cassandra= ? >> I >> >>>> am >> >>>> using Hector. >> >>>> >> >>> >> >>> >> >> >> > >> >