Read using a qualifier regex filter (HBase)

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

Documentation pages that include this code sample

To view the code sample used in context, see the following documentation:

Code sample


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

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

public static void filterLimitColQualifierRegex(
    String projectId, String instanceId, String tableId) {
  // A filter that matches cells whose column qualifier satisfies the given regex
  Filter filter =
      new QualifierFilter(CompareOp.EQUAL, new RegexStringComparator("connected_.*$"));
  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.