public static class ColumnFilter.Builder
extends java.lang.Object
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, allColumnsBuilder (all
columns are fetched) or selectionBuilder (only the queried columns are fetched).
Note that for a allColumnsBuilder, 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 subselection of a complex column should be queried, then only the corresponding
subselection 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 subselection(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.Modifier and Type | Method and Description |
---|---|
ColumnFilter.Builder |
add(ColumnMetadata c) |
ColumnFilter.Builder |
addAll(java.lang.Iterable<ColumnMetadata> columns) |
ColumnFilter |
build() |
ColumnFilter.Builder |
select(ColumnMetadata c,
CellPath elt) |
ColumnFilter.Builder |
slice(ColumnMetadata c,
CellPath from,
CellPath to) |
public ColumnFilter.Builder add(ColumnMetadata c)
public ColumnFilter.Builder addAll(java.lang.Iterable<ColumnMetadata> columns)
public ColumnFilter.Builder slice(ColumnMetadata c, CellPath from, CellPath to)
public ColumnFilter.Builder select(ColumnMetadata c, CellPath elt)
public ColumnFilter build()
Copyright © 2009-2020 The Apache Software Foundation