A Fluent DSL to create a hierarchy of filters for the CheckAndMutateRow RPCs and ReadRows Query.
Intended usage is to statically import, or in case of conflict, assign the static variable
FILTERS and use its fluent API to build filters.
Sample code:
import staticcom.google.cloud.bigtable.data.v2.models.Filters.FILTERS;voidmain(){// Build the filter expressionRowFilterfilter=FILTERS.chain().filter(FILTERS.qualifier().regex("prefix.*")).filter(FILTERS.limit().cellsPerRow(10));// Use it in a QueryQueryquery=Query.create("[TABLE]").filter(filter);}
Creates an empty condition filter. The filter results of the predicate can be configured by
invoking ConditionFilter#then(Filters.Filter) and ConditionFilter#otherwise(Filters.Filter).
A RowFilter which evaluates one of two possible RowFilters, depending on whether or not a
predicate RowFilter outputs any cells from the input row.
IMPORTANT NOTE: The predicate filter does not execute atomically with the ConditionFilter#then(Filters.Filter) and ConditionFilter#otherwise(Filters.Filter)
(Filter)} filters, which may lead to inconsistent or unexpected results. Additionally, ConditionFilter may have poor performance, especially when filters are set for the ConditionFilter#otherwise(Filters.Filter).
Creates an empty interleave filter list. Filters can be added to the interleave by invoking
InterleaveFilter#filter(Filters.Filter).
The elements of "filters" all process a copy of the input row, and the results are pooled,
sorted, and combined into a single output row. If multiple cells are produced with the same
column and timestamp, they will all appear in the output row in an unspecified mutual order.
The full chain is executed atomically.
Applies the given label to all cells in the output row. This allows the caller to determine
which results were produced from which part of the filter.
Due to a technical limitation, it is not currently possible to apply multiple labels to a
cell. As a result, a ChainFilter may have no more than one sub-filter which contains a
label. It is okay for an InterleaveFilter to contain multiple labels, as they will be
applied to separate copies of the input. This may be relaxed in the future.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Class Filters (2.65.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.65.0 (latest)](/java/docs/reference/google-cloud-bigtable/latest/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.63.0](/java/docs/reference/google-cloud-bigtable/2.63.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.62.0](/java/docs/reference/google-cloud-bigtable/2.62.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.61.0](/java/docs/reference/google-cloud-bigtable/2.61.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.60.0](/java/docs/reference/google-cloud-bigtable/2.60.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.59.0](/java/docs/reference/google-cloud-bigtable/2.59.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.58.2](/java/docs/reference/google-cloud-bigtable/2.58.2/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.56.0](/java/docs/reference/google-cloud-bigtable/2.56.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.54.0](/java/docs/reference/google-cloud-bigtable/2.54.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.52.0](/java/docs/reference/google-cloud-bigtable/2.52.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.51.2](/java/docs/reference/google-cloud-bigtable/2.51.2/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.49.0](/java/docs/reference/google-cloud-bigtable/2.49.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.46.0](/java/docs/reference/google-cloud-bigtable/2.46.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.45.1](/java/docs/reference/google-cloud-bigtable/2.45.1/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.44.1](/java/docs/reference/google-cloud-bigtable/2.44.1/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.43.0](/java/docs/reference/google-cloud-bigtable/2.43.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.42.0](/java/docs/reference/google-cloud-bigtable/2.42.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.40.0](/java/docs/reference/google-cloud-bigtable/2.40.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.39.5](/java/docs/reference/google-cloud-bigtable/2.39.5/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.37.0](/java/docs/reference/google-cloud-bigtable/2.37.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.35.1](/java/docs/reference/google-cloud-bigtable/2.35.1/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.34.0](/java/docs/reference/google-cloud-bigtable/2.34.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.33.0](/java/docs/reference/google-cloud-bigtable/2.33.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.32.0](/java/docs/reference/google-cloud-bigtable/2.32.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.31.0](/java/docs/reference/google-cloud-bigtable/2.31.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.30.0](/java/docs/reference/google-cloud-bigtable/2.30.0/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.29.1](/java/docs/reference/google-cloud-bigtable/2.29.1/com.google.cloud.bigtable.data.v2.models.Filters)\n- [2.28.0](/java/docs/reference/google-cloud-bigtable/2.28.0/com.google.cloud.bigtable.data.v2.models.Filters) \n\n public final class Filters\n\nA Fluent DSL to create a hierarchy of filters for the CheckAndMutateRow RPCs and ReadRows Query.\n\nIntended usage is to statically import, or in case of conflict, assign the static variable\nFILTERS and use its fluent API to build filters.\n\nSample code: \n\n\n import static com.google.cloud.bigtable.data.v2.models.Filters.FILTERS;\n\n void main() {\n // Build the filter expression\n RowFilter filter = FILTERS.chain()\n .filter(FILTERS.qualifier().regex(\"prefix.*\"))\n .filter(FILTERS.limit().cellsPerRow(10));\n\n // Use it in a Query\n Query query = Query.create(\"[TABLE]\")\n .filter(filter);\n }\n\n \nInheritance\n-----------\n\n[java.lang.Object](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html) \\\u003e Filters \n\nInherited Members\n-----------------\n\n[Object.clone()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--) \n[Object.equals(Object)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-) \n[Object.finalize()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--) \n[Object.getClass()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--) \n[Object.hashCode()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--) \n[Object.notify()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--) \n[Object.notifyAll()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--) \n[Object.toString()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--) \n[Object.wait()](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--) \n[Object.wait(long)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-) \n[Object.wait(long,int)](https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-)\n\nStatic Fields\n-------------\n\n### FILTERS\n\n public static final Filters FILTERS\n\nEntry point into the DSL.\n\nMethods\n-------\n\n### block()\n\n public Filters.Filter block()\n\nDoes not match any cells, regardless of input. Useful for temporarily disabling just part of a\nfilter.\n\n### chain()\n\n public Filters.ChainFilter chain()\n\nCreates an empty chain filter list. Filters can be added to the chain by invoking ChainFilter#filter(Filters.Filter).\n\nThe elements of \"filters\" are chained together to process the input row: \n\n in row -\u003e filter0 -\u003e intermediate row -\u003e filter1 -\u003e ... -\u003e filterN -\u003e out row\n \nThe full chain is executed atomically.\n\n### condition(Filters.Filter predicate)\n\n public Filters.ConditionFilter condition(Filters.Filter predicate)\n\nCreates an empty condition filter. The filter results of the predicate can be configured by\ninvoking ConditionFilter#then(Filters.Filter) and ConditionFilter#otherwise(Filters.Filter).\n\nA RowFilter which evaluates one of two possible RowFilters, depending on whether or not a\npredicate RowFilter outputs any cells from the input row.\n\nIMPORTANT NOTE: The predicate filter does not execute atomically with the ConditionFilter#then(Filters.Filter) and ConditionFilter#otherwise(Filters.Filter)\n(Filter)} filters, which may lead to inconsistent or unexpected results. Additionally, ConditionFilter may have poor performance, especially when filters are set for the ConditionFilter#otherwise(Filters.Filter).\n\n### family()\n\n public Filters.FamilyFilter family()\n\nReturns the builder for column family related filters.\n\n### fromProto(RowFilter rowFilter)\n\n public Filters.Filter fromProto(RowFilter rowFilter)\n\nWraps protobuf representation of a filter.\n\nFor advanced use only.\n\n### interleave()\n\n public Filters.InterleaveFilter interleave()\n\nCreates an empty interleave filter list. Filters can be added to the interleave by invoking\nInterleaveFilter#filter(Filters.Filter).\n\nThe elements of \"filters\" all process a copy of the input row, and the results are pooled,\nsorted, and combined into a single output row. If multiple cells are produced with the same\ncolumn and timestamp, they will all appear in the output row in an unspecified mutual order.\nThe full chain is executed atomically.\n\n### key()\n\n public Filters.KeyFilter key()\n\nReturns the builder for row key related filters.\n\n### label(String label)\n\n public Filters.Filter label(String label)\n\nApplies the given label to all cells in the output row. This allows the caller to determine\nwhich results were produced from which part of the filter.\n\nDue to a technical limitation, it is not currently possible to apply multiple labels to a\ncell. As a result, a ChainFilter may have no more than one sub-filter which contains a\nlabel. It is okay for an InterleaveFilter to contain multiple labels, as they will be\napplied to separate copies of the input. This may be relaxed in the future.\n\n### limit()\n\n public Filters.LimitFilter limit()\n\nReturns the builder for limit related filters.\n\n### offset()\n\n public Filters.OffsetFilter offset()\n\nReturns the builder for offset related filters.\n\n### pass()\n\n public Filters.Filter pass()\n\nMatches all cells, regardless of input. Functionally equivalent to having no filter.\n\n### qualifier()\n\n public Filters.QualifierFilter qualifier()\n\nReturns the builder for column qualifier related filters.\n\n### sink()\n\n public Filters.Filter sink()\n\nOutputs all cells directly to the output of the read rather than to any parent filter. For\nadvanced usage, see comments in\n\u003chttps://github.com/googleapis/googleapis/blob/master/google/bigtable/v2/data.proto\u003e for more\ndetails.\n\n### timestamp()\n\n public Filters.TimestampFilter timestamp()\n\nReturns the builder for timestamp related filters.\n\n### value()\n\n public Filters.ValueFilter value()\n\nReturns the builder for value related filters."]]