Skip to Content
Mastering Apache Cassandra 3.x - Third Edition
book

Mastering Apache Cassandra 3.x - Third Edition

by Aaron Ploetz, Tejaswi Malepati
October 2018
Beginner to intermediate content levelBeginner to intermediate
348 pages
10h
English
Packt Publishing
Content preview from Mastering Apache Cassandra 3.x - Third Edition

Executing a BATCH statement

One of the more controversial features of CQL is the BATCH statement. Essentially, this allows for write operations to be grouped together and applied at once, automatically. Therefore, if one of the statements should fail, they are all rolled back. A common application of this is for developers to write the same data to multiple query tables, keeping them in sync. BATCH statements in CQL can be applied as such:

BEGIN BATCH INSERT INTO security_logs_by_location (location_id,day,time_in,employee_id,mailstop) VALUES ('MPLS2',20180726,'2018-07-26 11:45:22.004','robp','M266'); INSERT INTO security_logs_by_location_desc (location_id,day,time_in,employee_id,mailstop) VALUES ('MPLS2',20180726,'2018-07-26 11:45:22.004','robp','M266'); ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Apache Cassandra - Second Edition

Mastering Apache Cassandra - Second Edition

Nishant Neeraj

Publisher Resources

ISBN: 9781789131499Supplemental Content