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 41090929C for ; Wed, 28 Mar 2012 08:12:12 +0000 (UTC) Received: (qmail 8316 invoked by uid 500); 28 Mar 2012 08:12:09 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 8289 invoked by uid 500); 28 Mar 2012 08:12:09 -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 8266 invoked by uid 99); 28 Mar 2012 08:12:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2012 08:12:09 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of benjamin.j.mccann@gmail.com designates 209.85.212.178 as permitted sender) Received: from [209.85.212.178] (HELO mail-wi0-f178.google.com) (209.85.212.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Mar 2012 08:12:02 +0000 Received: by wibhq7 with SMTP id hq7so562877wib.7 for ; Wed, 28 Mar 2012 01:11:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:content-type; bh=BmXWJ2JBCdIKsSCcwj8YXeiRmJQQHPOd17kSvDRMrUQ=; b=LpdAQnYL+RR4frrllEUVCf0ojHB8wgj1vOKWjvQoHaqipLzIjcGPQ2sIrXSGsXFaca tqIM4XI7eohT4VqE8Fv9FSWr27ZGVabvvaFd85t3w5q9AnsW3MgsOR5xb5Re821/M0Bu oYTd18UnTadbbkeSUh/6wqNL6b0PIRSRVGSl4xILQ+mJLh8Q0s6stDJ6hq2Q2fNR/lXJ ZURMoQXCAOoM9YpMa6gJm+VoQ8ZuNMSG71qwgrrSLesDPcH4ryMZz4p13yJKyzHqaG+t d/QC52GbtOlOxdDAD2A8JXgOKjVkPflxHQbNXMoZl8Hu1Azkt6uwwQtoo3h44e2Tq0aO aacQ== MIME-Version: 1.0 Received: by 10.216.135.225 with SMTP id u75mr15415386wei.97.1332922302097; Wed, 28 Mar 2012 01:11:42 -0700 (PDT) Sender: benjamin.j.mccann@gmail.com Received: by 10.216.230.95 with HTTP; Wed, 28 Mar 2012 01:11:42 -0700 (PDT) In-Reply-To: References: Date: Wed, 28 Mar 2012 01:11:42 -0700 X-Google-Sender-Auth: E99cALNTpfhT017D9-vjceE7mz4 Message-ID: Subject: Re: How to store a list of values? From: Ben McCann To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e6de1748546b4404bc492891 --0016e6de1748546b4404bc492891 Content-Type: text/plain; charset=ISO-8859-1 Hmm. I thought that Cassandra would encode the composite column without the colon and that it was only there for illustration purposes, so the suggestion to use ~ is confusing. Are there some docs you can point me to? Also, after some reading, it seems to me that it is not even possible to have a composite column together with a regular column in a column family in this manner. On Wed, Mar 28, 2012 at 12:34 AM, R. Verlangen wrote: > Yes, that is one of the possible solutions to your problem. > > When you want to retrieve only the skills of a particular row just get the > columns with as start value "skill:". > > A suggestion to your example might be to use a ~ in stead of : as > separator. A tilde is used less often in standard sentences, so you could > replace any of them in skills with some other character (e.g. a dash or > whitespace). > > 2012/3/27 Ben McCann > >> I was given one other suggestion (which may have been suggested earlier >> in this thread, but is clearer to me with an example). The suggestion was >> to use composite columns and have the first part of the key name be "skill" >> and the second part be the specific skill and then store a null value. I >> hope I understood this suggestion correctly. >> >> user: { >> 'name': 'ben', >> 'title': 'software engineer', >> 'company': 'google', >> 'location': 'orange county', >> 'skill:java': '', >> 'skill:html': '', >> 'skill:javascript': '' >> } >> >> >> On Tue, Mar 27, 2012 at 12:04 AM, samal wrote: >> >>> YEAH! agree, it only matter for time bucket data. >>> >>> >>> On Tue, Mar 27, 2012 at 12:31 PM, R. Verlangen wrote: >>> >>>> That's true, but it does not sound like a real problem to me.. Maybe >>>> someone else can shed some light upon this. >>>> >>>> >>>> 2012/3/27 samal >>>> >>>>> >>>>> >>>>> On Tue, Mar 27, 2012 at 1:47 AM, R. Verlangen wrote: >>>>> >>>>>> " but any schema change will break it " >>>>>> >>>>>> How do you mean? You don't have to specify the columns in Cassandra >>>>>> so it should work perfect. Except for the "skill~" is preserverd for your >>>>>> list. >>>>>> >>>>> >>>>> In case skill~ is decided to change to skill:: , it need to be handle >>>>> at app level. Or otherwise had t update in all row, read it first, modify >>>>> it, insert new version and delete old version. >>>>> >>>>> >>>> >>>> >>>> -- >>>> With kind regards, >>>> >>>> Robin Verlangen >>>> www.robinverlangen.nl >>>> >>>> >>> >> > > > -- > With kind regards, > > Robin Verlangen > www.robinverlangen.nl > > --0016e6de1748546b4404bc492891 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hmm. I thought that Cassandra would encode the composite column without the= colon and that it was only there for illustration purposes, so the suggest= ion to use ~ is confusing. =A0Are there some docs you can point me to? =A0A= lso, after some reading, it seems to me that it is not even possible to hav= e a composite column together with a regular column in a column family in t= his manner.


On Wed, Mar 28, 2012 at 12:34= AM, R. Verlangen <rob= in@us2.nl> wrote:
Yes, that is one of the possible solutions to your problem.

<= div>When you want to=A0retrieve=A0only the skills of a particular row just = get the columns with as start value "skill:".

A suggestion to your example might be to use a ~ in stead of : as sepa= rator. A tilde is used less often in standard sentences, so you could repla= ce any of them in skills with some other character (e.g. a dash or whitespa= ce).

2012/3/27 Ben McCann = <ben@benmccann.co= m>
I was given one other suggestion (which may have been suggested earlier in = this thread, but is clearer to me with an example). =A0The suggestion was t= o use composite columns and have the first part of the key name be "sk= ill" and the second part be the specific skill and then store a null v= alue. =A0I hope I understood this suggestion correctly.

user: {
=A0 'name': 'ben',
=A0 'title': 'software engineer',
=A0 'com= pany': 'google',
=A0 'location': 'orange = county',
=A0 'skill:java': '',
=A0 'skill:html= 9;: '',
=A0 'skill:javascript': ''
<= div>
}


On Tue, Mar 27, 2012 at 12:04 AM, samal <samalgorai@gmail.com> wrote:
YEAH! agree, it only matter for time bucket = data.


On Tue, Mar 27, 2012 at 1= 2:31 PM, R. Verlangen <robin@us2.nl> wrote:
That's true, but it does not sound like a real problem to me.. Maybe so= meone else can shed some light upon this.


2012/3/27 samal <samalgorai@gmail.com>


On T= ue, Mar 27, 2012 at 1:47 AM, R. Verlangen <robin@us2.nl> wrote:
" but any schema change will break it "

How do you mean? You don't have= to specify the columns in Cassandra so it should work perfect. Except for = the "skill~" is preserverd for your list.

=A0In case skill~ is decided to change to skill= :: , it need to be handle at app level. Or otherwise had t update in all ro= w, read it first, modify it, insert new version and delete old version.




--
With kind regards,

Robin Verlangen
<= a href=3D"http://www.robinverlangen.nl" target=3D"_blank">www.robinverlange= n.nl






--
= With kind regards,

Robin Verlangen

--0016e6de1748546b4404bc492891--