Delete delete = QueryBuilder.delete()
.from("addresbook", "contact")
.where(eq("username", "dgarcia"));
what is the type of "eq" in where clause
Delete example here
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.
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.
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.
To remove all rows from a CQL Table, you can use the TRUNCATE command: TRUNCATE keyspace_name.
import static com.datastax.driver.core.querybuilder.QueryBuilder.eq;
Cheers, Carlo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With