Cloud Bigtable Client - Class KeyFilter (2.5.0)

Reference documentation and code samples for the Cloud Bigtable Client class KeyFilter.

A builder used to configure row key related filters.

Example:

use Google\Cloud\Bigtable\Filter;

$builder = Filter::key();

Namespace

Google \ Cloud \ Bigtable \ Filter \ Builder

Methods

regex

Matches only cells from rows whose keys satisfy the given RE2 regex. In other words, passes through the entire row when the key matches, and otherwise produces an empty row. Note that, since row keys can contain arbitrary bytes, the \C escape sequence must be used if a true wildcard is desired. The . character will not match the new line character \n, which may be present in a binary key.

Example:

$keyFilter = $builder->regex('prefix.*');
Parameter
Name Description
value string

A regex value.

Returns
Type Description
Google\Cloud\Bigtable\Filter\SimpleFilter

exactMatch

Matches only cells from rows whose keys equal the value. In other words, passes through the entire row when the key matches, and otherwise produces an empty row.

Example:

$keyFilter = $builder->exactMatch('r1');
Parameter
Name Description
value array|string

An exact value.

Returns
Type Description
Google\Cloud\Bigtable\Filter\SimpleFilter

sample

Matches all cells from a row with probability, and matches no cells from the row with probability 1-probability.

Example:

$keyFilter = $builder->sample(.7);
Parameter
Name Description
probability float

The probability to filter by. Must be within the range [0, 1], end points excluded.

Returns
Type Description
Google\Cloud\Bigtable\Filter\SimpleFilter