Create and manage continuous materialized views
This document describes how to create and perform operations on a continuous materialized view in Bigtable. Before you read this document, read the overview at Continuous materialized views.
You can create a continuous materialized view using the Google Cloud CLI, the Bigtable Studio query editor in the Google Cloud console, or the Bigtable client libraries for Java and Go.
Before you begin
Take the following steps if you plan to use the gcloud CLI.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init
Required roles
To get the permissions that you need to create and manage continuous
materialized views, ask your administrator to grant you the
Bigtable Admin (roles/bigtable.admin) role on the instance.
Otherwise, ask for the following permissions at the instance level, depending on
the operation that you want to perform:
- Create:
bigtable.materializedViews.create - Update:
bigtable.materializedViews.update - Delete:
bigtable.materializedViews.delete - List:
bigtable.materializedViews.list
To create a continuous materialized view, you must also have at least
bigtable.tables.readRows permission on the source table.
To see all available roles and permissions, see Bigtable access control with IAM.
Create a continuous materialized view
Before you create a continuous materialized view, do the following:
- Optional: As a best practice, enable autoscaling for clusters in your instance to make sure they can scale up if necessary while Bigtable processes and synchronizes the continuous materialized view and to handle any additional storage usage.
- Identify a Bigtable table that you have permission to read to use as the source for the continuous materialized view.
- Prepare the SQL query that defines your continuous materialized view. For query requirements, see