NoSQL: Cassandra Batch to execute multiple Statements

In this post, I am sharing basic help to execute multiple statements using one single Cassandra batch.

Many times, it is required to execute multiple statements using single batch.
Cassandra CQL provides the BEGIN BATCH…APPLY BATCH command to execute multiple statements.

Below is a small demonstration:

Create Keyspace if not exists:

Use a Keyspace:
Create a Sample Table:
Insert few sample records:
Execute INSERT, UPDATE, DELETE using one Single Batch command:
Check the result:
Anvesh Patel

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz