What exactly is your requirement? Is the read before write mandatory? Are you maintaining states in Cassandra?
Regards Prathmesh Ranaut https://linkedin.com/in/prathmeshranaut > On Aug 29, 2019, at 3:35 PM, Shyam P <shyamabigd...@gmail.com> wrote: > > > thanks Aayush. For every record I need to get the data from cassandra > table and update it ? Else it may not update the existing record. > > What is this datastax-spark-connector ? is that not a "Cassandra > connector library written for spark"? > If not , how to write ourselves. > Where and how to start ? Can you please guide me. > > > > Thank you. > Shyam > > > > > On Thu, Aug 29, 2019 at 5:03 PM Aayush Ranaut <aayush.ran...@gmail.com >> wrote: > >> Cassandra is upsert, you should be able to do what you need with a single >> statement unless you’re looking to maintain counters. >> >> I’m not sure if there is a Cassandra connector library written for spark >> streaming because we wrote one ourselves when we wanted to do the same. >> >> Regards >> Prathmesh Ranaut >> https://linkedin.com/in/prathmeshranaut >> >> >> On Aug 29, 2019, at 7:21 AM, Shyam P <shyamabigd...@gmail.com >>> wrote: >> >> >>> Hi, >>> I need to do a PoC for a business use-case. >>> >>> Use case : Need to update a record in Cassandra table if exists. >>> >>> Will spark streaming support compare each record and update existing >>> Cassandra record ? >>> >>> For each record received from kakfa topic , If I want to check and compare >>> each record whether its already there in Cassandra or not , if yes , update >>> the record else insert a new record. >>> >>> How can be this done using spark-structured streaming and cassandra? any >>> snippet or sample if you have. >>> >>> Thank you, >>> >>> Shyam >>> >>> >>> >>> >>> >> >> >