To organize components of your SQL workflow into collections, you can add custom tags to SQLX files of the following types:
table
view
incremental
assertion
operations
During workflow execution, you can execute only files with a selected tag.
With Cloud Composer or Workflows together with Cloud Scheduler, you can create a schedule that executes a Dataform workflow with a selected tag at a specific interval.
Before you begin
In the Google Cloud console, go to the Dataform page.
Select or create a repository.
Select or create a development workspace.
Define a SQLX file of any of the following types:
Required roles
To get the permissions that you need to add a tag to a table,
ask your administrator to grant you the
Dataform Editor (roles/dataform.editor
) IAM role on workspaces.
For more information about granting roles, see Manage access to projects, folders, and organizations.
You might also be able to get the required permissions through custom roles or other predefined roles.
Add a tag
You can add multiple tags to a SQLX file.
To add a tag to a SQLX file, follow these steps:
- Go to your development workspace.
- In the Files pane, expand
definitions/
. - Select a SQLX file.
In the
config
block, add a tag in the following format:tags: ["CUSTOM_TAG"]
Replace CUSTOM_TAG with your tag.
Optional: To add multiple tags, separate them with a comma
,
.Optional: Click Format.
The following code sample shows the user_counts
view with the daily
and hourly
tags:
config {
type: "view",
name: "user_counts",
tags: ["daily", "hourly"]
}
What's next
- To learn how to trigger executions, see Trigger execution.
- To learn how to add BigQuery policy tags in Dataform, see Add BigQuery policy tags