incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "R. Verlangen" <ro...@us2.nl>
Subject Re: How to store a list of values?
Date Wed, 28 Mar 2012 08:19:47 GMT
If you use the CompositeColumn it does, but it looked to me in your example
you just used the simple utf8-based solution. My apologies for the
confusion.

2012/3/28 Ben McCann <ben@benmccann.com>

> 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 <robin@us2.nl> 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 <ben@benmccann.com>
>>
>>> 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 <samalgorai@gmail.com> wrote:
>>>
>>>> YEAH! agree, it only matter for time bucket data.
>>>>
>>>>
>>>> On Tue, Mar 27, 2012 at 12:31 PM, R. Verlangen <robin@us2.nl> 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 <samalgorai@gmail.com>
>>>>>
>>>>>>
>>>>>>
>>>>>> On Tue, 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.
>>>>>>>
>>>>>>
>>>>>>  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
>>
>>
>


-- 
With kind regards,

Robin Verlangen
www.robinverlangen.nl

Mime
View raw message