0

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.

BdEngineer
  • 2,929
  • 4
  • 49
  • 85

1 Answers1

0

Do a normal write in Cassandra using the Spark-Cassandra connector. If the row key is already present, it will get updated and if not, it will be inserted.

This is how Cassandra works. Insert and Update, both perform write operations.

Hope this helps!

Vihit Shah
  • 314
  • 1
  • 5
  • see this https://stackoverflow.com/questions/50037285/writing-spark-structure-streaming-data-into-cassandra – AbhishekN Sep 11 '19 at 20:45