cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Burton <bur...@spinn3r.com>
Subject Re: Pattern to store maps of maps...
Date Sat, 14 Jun 2014 19:57:26 GMT
Wow.. that's the right answer.  Now I'm super excited for C* 2.1 :) ..

yeah.. that would work perfectly.  having custom types would perfectly
solve my problem.

Now the issue is whether I wait for the next version or just push through
this version…


On Sat, Jun 14, 2014 at 2:24 AM, DuyHai Doan <doanduyhai@gmail.com> wrote:

> Every thing is possible with Thrift, provided that you manage every  thing
> manually client side. Having coded an implementation of Achilles (object
> mapper) over Hector, it was really painfull to manage collections in Thrift.
>
>  Now to stick to the topic, if you want to nest collections into
> collections, it'll be possible in C* 2.1 with user defined types:
> http://www.datastax.com/dev/blog/cql-in-2-1
>
>
> On Sat, Jun 14, 2014 at 7:01 AM, Johan Edstrom <seijoed@gmail.com> wrote:
>
>> Well to throw fire on the debate, that was actually really simple in
>> Thrift.
>>
>> On Jun 13, 2014, at 10:50 PM, Kevin Burton <burton@spinn3r.com> wrote:
>>
>> > I could see just saying screw it and storing a serialized json object
>> that gets read back in automatically as a map.  That wouldn't be too
>> painful but just not super pretty in terms of representing the data in
>> cassandra.
>> >
>> >
>> > On Fri, Jun 13, 2014 at 8:45 PM, Jack Krupansky <
>> jack@basetechnology.com> wrote:
>> > The first question is how you need to access this data. Do you need to
>> directly access “bar” from a SELECT? Do you need to access “foo” as... what
>> – Java Map, or what?
>> >
>> > That said, you can always flatten a map of maps by simply concatenating
>> the keys, such as {“foo_bar”: “hello”} and then you can select ‘foo_bar’.
>> Ditto for additional levels. And if you want each of the intermediate
>> levels, pick a serialization format such as JSON or BSON in addition to the
>> flattened leaf values. Anything in your use case(s) that doesn’t cover?
>> >
>> > -- Jack Krupansky
>> >
>> > From: Kevin Burton
>> > Sent: Friday, June 13, 2014 8:17 PM
>> > To: user@cassandra.apache.org
>> > Subject: Pattern to store maps of maps...
>> >
>> > So the cassandra map support in CQL is nice but it's got me wanting
>> deeper nesting.
>> >
>> > For example { "foo": { "bar": "hello" } }
>> >
>> > … but that's not possible with CQL.
>> >
>> > Of course… one solution is something like avro, and then store your
>> entire record as a blob.
>> >
>> > I guess that's not TOO bad but that means all my data is somewhat
>> opaque to cqlsh.
>> >
>> > What are my options here?  What are you guys doing to work around this
>> problem?
>> >
>> > --
>> >
>> > Founder/CEO Spinn3r.com
>> > Location: San Francisco, CA
>> > Skype: burtonator
>> > blog: http://burtonator.wordpress.com
>> > … or check out my Google+ profile
>> >
>> > War is peace. Freedom is slavery. Ignorance is strength. Corporations
>> are people.
>> >
>> >
>> >
>> > --
>> >
>> > Founder/CEO Spinn3r.com
>> > Location: San Francisco, CA
>> > Skype: burtonator
>> > blog: http://burtonator.wordpress.com
>> > … or check out my Google+ profile
>> >
>> > War is peace. Freedom is slavery. Ignorance is strength. Corporations
>> are people.
>> >
>>
>>
>


-- 

Founder/CEO Spinn3r.com
Location: *San Francisco, CA*
Skype: *burtonator*
blog: http://burtonator.wordpress.com
… or check out my Google+ profile
<https://plus.google.com/102718274791889610666/posts>
<http://spinn3r.com>
War is peace. Freedom is slavery. Ignorance is strength. Corporations are
people.

Mime
View raw message