Skip to content

Files

Latest commit

e4429a2 · Nov 10, 2023

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Nov 10, 2023

TRUNCATE

To create a TRUNCATE query, use one of the truncate methods in QueryBuilder. There are several variants depending on whether your table name is qualified, and whether you use identifiers or raw strings:

import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.*;

Truncate truncate = truncate("ks", "mytable");
// TRUNCATE ks.mytable

Truncate truncate2 = truncate(CqlIdentifier.fromCql("mytable"));
// TRUNCATE mytable

Note that, at this stage, the query is ready to build. After creating a TRUNCATE query it does not take any values.