Re: Write to cassandra...each individual statement

2015-08-13 Thread Philip Weaver
So you need some state between messages in a partition. You can use mapPartitions or foreachPartition, which allow you to write code to process an entire partition. On Thu, Aug 13, 2015 at 11:48 AM, Priya Ch wrote: > Hi Philip, > > I have the following requirement - > I read the streams of data

Re: Write to cassandra...each individual statement

2015-08-13 Thread Priya Ch
Hi Philip, I have the following requirement - I read the streams of data from various partitions of kafka topic. And then I union the dstreams and apply hash partitioner so messages of same key would go into single partition of an rdd, which is ofcourse handled by a single thread. This way we try

Re: Write to cassandra...each individual statement

2015-08-13 Thread Philip Weaver
All you'd need to do is *transform* the rdd before writing it, e.g. using the .map function. On Thu, Aug 13, 2015 at 11:30 AM, Priya Ch wrote: > Hi All, > > I have a question in writing rdd to cassandra. Instead of writing entire > rdd to cassandra, i want to write individual statement into ca