0

Current Approach that i am using for deleting rows based on indexed column

  1. Select query with a limit 100.
  2. If there are rows Delete all the fetched rows one by one.
  3. Flush the entity Manager.
  4. Go to step 1.

Using cassandra 2.1.8 and kundera-cassandra-ds-driver for fetching rows from cassandra.

Is there any way to fire a delete query from Kundera.

Prabhath
  • 629
  • 6
  • 13

1 Answers1

1

You can do the following:

Query findQuery = entityManager.createQuery("Delete from PersonCassandra p where p.age = 10",
            PersonCassandra.class);
findQuery.setMaxResults(5000);
findQuery.executeUpdate();

PS: Cassandra does not allow deleting rows based on non-primary keys, Kundera handles this internally in a similar way that you are doing.

karthik manchala
  • 13,492
  • 1
  • 31
  • 55