You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by Anton B <to...@gmail.com> on 2014/01/29 08:40:47 UTC

Cassandra composite and simple keys

Greetings,

I need to read data from Cassandra row which has both composite and simple
keys. As far as I understand I need CompositeType instance to read composite
keys and some "primitive" types to read simple ones. But how to tell which
row I'm reading at the moment?
I didn't find any methods on IColumn to tell composite key from simple one.
What am I missing here?
How one would read data from rows with mixed composite and simple keys in
Spark/Hadoop?

Thanks a lot,
Anton



--
View this message in context: http://apache-spark-user-list.1001560.n3.nabble.com/Cassandra-composite-and-simple-keys-tp1013.html
Sent from the Apache Spark User List mailing list archive at Nabble.com.

Re: Cassandra composite and simple keys

Posted by Heiko Braun <ik...@googlemail.com>.
Since C* + Spark seems to be used quiet a lot, maybe you guys could update the docs & examples with a description of the different approaches? I.e. benefits and drawbacks, etc ?  I think this would be of great help for the community.

Regards, Heiko

On 31 Jan 2014, at 16:49, Rohit Rai <ro...@tuplejump.com> wrote:

> Hi Anton,
> 
> I'll recommend using CqlPagingInputFormat instead of CFIF while dealing with composite key... In which case Cassandra takes care of serializing the data back as simple columns.
> 
> Shameless Plug: Use our C*+Spark library Calliope ( http://tuplejump.github.io/calliope/ ) if you are using Spark on Cassandra. It provides a much easier and more powerful interface to work with and saves you a lot of trouble...
> 
> Regards,
> Rohit
> 


Re: Cassandra composite and simple keys

Posted by Rohit Rai <ro...@tuplejump.com>.
Hi Anton,

I'll recommend using CqlPagingInputFormat instead of CFIF while dealing
with composite key... In which case Cassandra takes care of serializing the
data back as simple columns.

Shameless Plug: Use our C*+Spark library Calliope (
http://tuplejump.github.io/calliope/ ) if you are using Spark on Cassandra.
It provides a much easier and more powerful interface to work with and
saves you a lot of trouble...

Regards,
Rohit

 On Jan 29, 2014 1:12 PM, "Anton B" <to...@gmail.com> wrote:

> Greetings,
>
> I need to read data from Cassandra row which has both composite and simple
> keys. As far as I understand I need CompositeType instance to read
> composite
> keys and some "primitive" types to read simple ones. But how to tell which
> row I'm reading at the moment?
> I didn't find any methods on IColumn to tell composite key from simple one.
> What am I missing here?
> How one would read data from rows with mixed composite and simple keys in
> Spark/Hadoop?
>
> Thanks a lot,
> Anton
>
>
>
> --
> View this message in context:
> http://apache-spark-user-list.1001560.n3.nabble.com/Cassandra-composite-and-simple-keys-tp1013.html
> Sent from the Apache Spark User List mailing list archive at Nabble.com.
>