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 2E3B6C4A1 for ; Thu, 17 May 2012 07:23:50 +0000 (UTC) Received: (qmail 52941 invoked by uid 500); 17 May 2012 07:23:47 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 52772 invoked by uid 500); 17 May 2012 07:23:47 -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 52751 invoked by uid 99); 17 May 2012 07:23:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2012 07:23:47 +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 samalgorai@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-wg0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 17 May 2012 07:23:40 +0000 Received: by wgbdr13 with SMTP id dr13so1172276wgb.25 for ; Thu, 17 May 2012 00:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=fBj8o4CLcnKaiFSFB+mUb1UEtKMAp1NKFvKX5hPzhLs=; b=c4KqV832+qotfFrjQO66EgtM3HS8zF0zEUypYy/a8NS/H7jtM7zesnL39t6Dw54Bml rg6Gz86/DldHds7YcLhiK//PdNai912U7bjHtu3/BO/0bzXfdJZXvsoZENaqsdh9zWnt 4vdEQjgFpMNv1fdFgD6XkiZI0bEc76RcTnGStaB1Zw4GHrP9bWIrNFaicmtNCWo6gD9r /t38AJgIzVSowXlTuQsR/dcbPhP5y76tg5RwAJZjW2tRWx3KJuBvP/xB/bHsdMQaIkXQ 1coT950/wpm3PcbWkoqnOAAxRbGCzacWVmMlouP2NIOznwlEG4bA3UHzeUIwo7xBUHAa ebPw== MIME-Version: 1.0 Received: by 10.216.140.160 with SMTP id e32mr3952743wej.46.1337239400497; Thu, 17 May 2012 00:23:20 -0700 (PDT) Received: by 10.223.158.66 with HTTP; Thu, 17 May 2012 00:23:20 -0700 (PDT) In-Reply-To: References: <7C59F6B0-3882-4E6C-A79B-58F209EB82B3@thelastpickle.com> Date: Thu, 17 May 2012 12:53:20 +0530 Message-ID: Subject: Re: Composite Column From: samal To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e6de00d372437204c0364f0a --0016e6de00d372437204c0364f0a Content-Type: text/plain; charset=UTF-8 zCassandra data model is best known for demoralize data. You must have entry for column name in other column family. Example is just for posterity, you should not put everything in single row, very inefficient. I do not use composite column. The way I do and others do is use complex column. rowkey=>username coulmns=>subsets of user employee1={ name: . . previous_job_xxx_company:null previous_job_yyy_company:null } employee2={ name: . . previous_job::aaa_company:null previous_job::yyy_company:null } Here you get entire row, as row size is small, filter the similar details by marker *[previous_job::* is marker here and *xxx_company* is real value which we need, column value is not required(that depends on requirement)]. Their is very good presentation by datastax folk http://www.datastax.com/2011/07/video-data-modeling-workshop-from-cassandra-sf-2011and Joe http://www.youtube.com/watch?v=EBjWlH4NPMA , it will help you understand data model. @samalgorai On Thu, May 17, 2012 at 12:29 PM, Abhijit Chanda wrote: > Samal, > > Thanks buddy for interpreting. Now suppose i am inserting data in a column > family using this data model dynamically, as a result columnNames will be > dynamic. Now consider there is a entry for *employee1* *name*d "Smith", > and i want to retrieve that value? > > Regards, > Abhijit > > On Thu, May 17, 2012 at 12:03 PM, samal wrote: > >> It is like using your super column inside columns name. >> >> empKey{ >> employee1+name:XXXXXX, >> employee1+addr:XXXXX, >> employee2+name:XXXXX, >> employee2+addr:XXXXX >> } >> >> Here all of your employee details are attached to one domain i.e. all of >> employee1 details will be *"employee1+[anytihng.........n numbers of >> column]"* >> >> comaprator=CompositeType(UTF8Type1,UTF8Type2,.......,n) >> >> /Samal >> >> On Thu, May 17, 2012 at 10:40 AM, Abhijit Chanda < >> abhijit.chanda0@gmail.com> wrote: >> >>> Aaron, >>> >>> Actually Aaron i am looking for a scenario on super columns being >>> replaced by composite column. >>> Say this is a data model using super column >>> rowKey{ >>> superKey1 { >>> Name, >>> Address, >>> City,..... >>> } >>> } >>> >>> Actually i am having confusion how exactly the data model will look if >>> we use composite column instead of super column. >>> >>> Thanks, >>> Abhijit >>> >>> >>> >>> On Wed, May 16, 2012 at 2:56 PM, aaron morton wrote: >>> >>>> Abhijit, >>>> Can you explain the data model a bit more. >>>> >>>> Cheers >>>> >>>> ----------------- >>>> Aaron Morton >>>> Freelance Developer >>>> @aaronmorton >>>> http://www.thelastpickle.com >>>> >>>> On 15/05/2012, at 10:32 PM, samal wrote: >>>> >>>> It is just column with JSON value >>>> >>>> On Tue, May 15, 2012 at 4:00 PM, samal wrote: >>>> >>>>> I have not used CC but yes you can. >>>>> Below is not composite column. It is not not column with JSON hash >>>>> value. Column value can be anything you like. >>>>> date inside value are not indexed. >>>>> >>>>> >>>>> On Tue, May 15, 2012 at 9:27 AM, Abhijit Chanda < >>>>> abhijit.chanda0@gmail.com> wrote: >>>>> >>>>>> Is it possible to create this data model with the help of composite >>>>>> column. >>>>>> >>>>>> User_Keys_By_Last_Name = { >>>>>> "Engineering" : {"anderson", 1 : "ac1263", "anderson", 2 : "724f02", ... }, >>>>>> "Sales" : { "adams", 1 : "b32704", "alden", 1 : "1553bd", ... }, >>>>>> } >>>>>> >>>>>> I am using Astyanax. Please suggest... >>>>>> -- >>>>>> Abhijit Chanda >>>>>> Software Developer >>>>>> VeHere Interactive Pvt. Ltd. >>>>>> +91-9748888395 >>>>>> >>>>>> >>>>> >>>> >>>> >>> >>> >>> -- >>> Abhijit Chanda >>> Software Developer >>> VeHere Interactive Pvt. Ltd. >>> +91-9748888395 >>> >>> >> > > > -- > Abhijit Chanda > Software Developer > VeHere Interactive Pvt. Ltd. > +91-9748888395 > > --0016e6de00d372437204c0364f0a Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable zCassandra data model is best known for demoralize data. You must have entr= y for column name in other column family.

Example is just for poste= rity, you should not put everything in single row, very inefficient.

I do not use composite column. The way I do and others do is use comple= x column.

rowkey=3D>username
coulmns=3D>subsets of user
=
employee1=3D{
=C2=A0=C2=A0 name:
=C2=A0=C2=A0=C2=A0 .
=C2=A0= =C2=A0=C2=A0 .
=C2=A0=C2=A0 previous_job_xxx_company:null
=C2=A0=C2=A0 previous_job_yyy_company:null
} =C2=A0
employee2=3D{ =C2=A0=C2=A0 name:
=C2=A0=C2=A0=C2=A0 .
=C2=A0=C2=A0=C2=A0 .
=C2=A0=C2=A0 previous_job::aaa_company:null
=C2=A0=C2=A0 previous_job::yyy_company:null
}

Here you get entire row, as row size is small, filter the similar = details by marker [previous_job:: is marker here and xxx_company<= /b> is real value which we need, column value is not required(that depends = on requirement)].

Their is very good presentation by datastax folk h= ttp://www.datastax.com/2011/07/video-data-modeling-workshop-from-cassandra-= sf-2011 and Joe http://www.youtube.com/watch?v=3DEBjWlH4NPMA , it will help you under= stand data model.

@samalgorai

On Thu, May 17, 2012 at 1= 2:29 PM, Abhijit Chanda <abhijit.chanda0@gmail.com> = wrote:
Samal,

Thanks buddy for interpreting.= Now suppose i am inserting data in a column family using this data model d= ynamically, as a result columnNames will be dynamic. Now consider there is = a entry for employee1 named "Smith", and i want to = retrieve that value?

Regards,
Abhijit =C2=A0
=
On Thu, May 17, 2012 at 12:03 PM, samal <samalgorai@gmail.com> wrote:
It is like using your super column inside columns name.

empKey{
= =C2=A0 employee1+name:XXXXXX,
=C2=A0 employee1+addr:XXXXX,
=C2=A0 emp= loyee2+name:XXXXX,
=C2=A0 employee2+addr:XXXXX
}

Here all of = your employee details are attached to one domain i.e. all of employee1 deta= ils will be "employee1+[anytihng.........n numbers of column]"=

comaprator=3DCompositeType(UTF8Type1,UTF8Type2,.......,n)

/Samal

On Thu, May 17, 2012 at 10:40 AM, Abhijit Chanda <abhiji= t.chanda0@gmail.com> wrote:
Aaron,

Actually Aaron i am looking fo= r a scenario on super columns being replaced by composite column.
Say th= is is a data model using super column
rowKey{
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 superKey1= {
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 =C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Name,
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Address,
=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0 City,.....
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0 }
}=C2=A0

Actually i am having confu= sion how exactly the data model will look if we use composite column instea= d of super column.

Thanks,
Abhijit







--
Abhijit Chanda
Software Developer
VeHere Inte= ractive Pvt. Ltd.
+91-9748888395





--
Abhijit Cha= nda
Software Developer
VeHere Interactive Pvt. Ltd.
+91-9748888395=


--0016e6de00d372437204c0364f0a--