Class ColumnFilter.Builder

java.lang.Object
org.apache.cassandra.db.filter.ColumnFilter.Builder
Enclosing class:
ColumnFilter

public static class ColumnFilter.Builder extends Object
A builder for a ColumnFilter object. Note that the columns added to this build are the _queried_ column. Whether or not all columns are _fetched_ depends on which constructor you've used to obtained this builder, allRegularColumnsBuilder (all columns are fetched) or selectionBuilder (only the queried columns are fetched). Note that for a allRegularColumnsBuilder, if no queried columns are added, this is interpreted as querying all columns, not querying none (but if you know you want to query all columns, prefer ColumnFilter.all(TableMetadata). For selectionBuilder, adding no queried columns means no column will be fetched (so the builder will return PartitionColumns.NONE). Also, if only a sub-selection of a complex column should be queried, then only the corresponding sub-selection method of the builder (slice(org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.rows.CellPath, org.apache.cassandra.db.rows.CellPath) or select(org.apache.cassandra.schema.ColumnMetadata, org.apache.cassandra.db.rows.CellPath)) should be called for the column, but add(org.apache.cassandra.schema.ColumnMetadata) shouldn't. if add(org.apache.cassandra.schema.ColumnMetadata) is also called, the whole column will be queried and the sub-selection(s) will be ignored. This is done for correctness of CQL where if you do "SELECT m, m[2..5]", you are really querying the whole collection.