Query protobuf data

This document provides examples of common query patterns for reading and querying protocol buffer (protobuf) data stored in Bigtable.

Before you read this page, familiarize yourself with the following:

Example data

The following examples use a Music table that stores information about albums and artists. The data is stored in a column family named album_details, with a column qualifier album. The column qualifier contains protobuf messages.

The protobuf schema is defined in the following proto files:

  • artist.proto:

    syntax = "proto3";
    
    package package_name;
    
    message Artist {
     string name = 1;
    }
    
  • album.proto:

    syntax = "proto3";
    
    package package_name;
    
    import "artist.proto";
    
    message Album {
     string title = 1;
     Artist artist = 2;
     int32 release_year = 3;
    }
    

As a result, Bigtable creates a schema bundle for this table that contains the following protobuf file descriptor set for these protobuf definitions:

file {
  name: