cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From samal <samalgo...@gmail.com>
Subject Re: Composite Column
Date Thu, 17 May 2012 07:23:20 GMT
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
<abhijit.chanda0@gmail.com>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 <samalgorai@gmail.com> 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 <aaron@thelastpickle.com>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 <samalgorai@gmail.com> 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
>
>

Mime
View raw message