Read using a family regex filter (HBase)

Stay organized with collections Save and categorize content based on your preferences.

Creates a limiting filter on a column family with a regex.

Explore further

For detailed documentation that includes this code sample, see the following:

Code sample


To learn how to install and use the client library for Bigtable, see Bigtable client libraries.

public static void filterLimitColFamilyRegex() {
  // TODO(developer): Replace these variables before running the sample.
  String projectId = "my-project-id";
  String instanceId = "my-instance-id";
  String tableId = "mobile-time-series";
  filterLimitColFamilyRegex(projectId, instanceId, tableId);

public static void filterLimitColFamilyRegex(
    String projectId, String instanceId, String tableId) {
  // A filter that matches cells whose column family satisfies the given regex
  Filter filter = new FamilyFilter(CompareOp.EQUAL, new RegexStringComparator("stats_.*$"));
  Scan scan = new Scan().setFilter(filter);
  readWithFilter(projectId, instanceId, tableId, scan);

What's next

To search and filter code samples for other Google Cloud products, see the Google Cloud sample browser.