Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Delete query in cassandra

Delete delete = QueryBuilder.delete()
  .from("addresbook", "contact")
  .where(eq("username", "dgarcia"));

what is the type of "eq" in where clause

Delete example here

like image 602
ING Avatar asked Feb 17 '15 11:02

ING


People also ask

How do you delete a query in Cassandra?

You have to store the query in a string variable and pass it to the execute() method as shown below. String query1 = ”DELETE FROM emp WHERE emp_id=3; ”; session. execute(query); Given below is the complete program to delete data from a table in Cassandra using Java API.

How does delete work in Cassandra?

Cassandra treats a delete as an insert or upsert. The data being added to the partition in the DELETE command is a deletion marker called a tombstone. The tombstones go through Cassandra's write path, and are written to SSTables on one or more nodes.

How do I delete multiple rows in Cassandra?

To delete more than one row, use the keyword IN and supply a list of values in parentheses, separated by commas: DELETE FROM cycling. cyclist_name WHERE firstname IN ('Alex', 'Marianne'); CQL supports an empty list of values in the IN clause, useful in Java Driver applications.

How do I delete all data from Cassandra?

To remove all rows from a CQL Table, you can use the TRUNCATE command: TRUNCATE keyspace_name.


1 Answers

import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;

Cheers, Carlo

like image 145
Carlo Bertuccini Avatar answered Oct 17 '22 04:10

Carlo Bertuccini