Bigtable Row Filters#
It is possible to use a
RowFilter
when adding mutations to a
ConditionalRow and when
reading row data with read_row()
read_rows().
As laid out in the RowFilter definition, the following basic filters are provided:
SinkFilterPassAllFilterBlockAllFilterRowKeyRegexFilterRowSampleFilterFamilyNameRegexFilterColumnQualifierRegexFilterTimestampRangeFilterColumnRangeFilterValueRegexFilterValueRangeFilterCellsRowOffsetFilterCellsRowLimitFilterCellsColumnLimitFilterStripValueTransformerFilterApplyLabelFilter
In addition, these filters can be combined into composite filters with
RowFilterChainRowFilterUnionConditionalRowFilter
These rules can be nested arbitrarily, with a basic filter at the lowest level. For example:
# Filter in a specified column (matching any column family).
col1_filter = ColumnQualifierRegexFilter(b'columnbia')
# Create a filter to label results.
label1 = u'label-red'
label1_filter = ApplyLabelFilter(label1)
# Combine the filters to label all the cells in columnbia.
chain1 = RowFilterChain(filters=[col1_filter, label1_filter])
# Create a similar filter to label cells blue.
col2_filter = ColumnQualifierRegexFilter(b'columnseeya')
label2 = u'label-blue'
label2_filter = ApplyLabelFilter(label2)
chain2 = RowFilterChain(filters=[col2_filter, label2_filter])
# Bring our two labeled columns together.
row_filter = RowFilterUnion(filters=[chain1, chain2])