Control column access

This document shows you how to control column access by adding BigQuerypolicy tags to table columns withDataform core.

You can setBigQuery policy tagson table columns in theconfig block in a table definition SQLX file.

Before you begin

  1. In the Google Cloud console, go to theDataform page.

    Go to the Dataform page

  2. Select orcreate a repository.

  3. Select orcreate a development workspace.

  4. Create a table.

Required roles

To get the permissions that you need to add a BigQuery policy tag to a table in Dataform, ask your administrator to grant you theDataform Editor (roles/dataform.editor) IAM role on workspaces. For more information about granting roles, seeManage access to projects, folders, and organizations.

You might also be able to get the required permissions throughcustom roles or otherpredefined roles.

Additionally, you must grant theBigQuery roles for column-level access controlto yourDataform service agent or custom service account.

Add a BigQuery policy tag

To add a BigQuery policy tag to a table column, follow these steps:

  1. Go to your development workspace.
  2. In theFiles pane, expanddefinitions/.
  3. Select a table definition SQLX file.
  4. In theconfig block, add a full tag identifier to a selectedcolumn in the following format:

    columns: {    column_name: {      bigqueryPolicyTags: ["FULL_TAG_IDENTIFIER"]    }  }

    ReplaceFULL_TAG_IDENTIFIER with the full identifierof the selected tag.

  5. Optional: ClickFormat.

The following code sample shows theprojects/example-project/locations/us/taxonomies/123456789/policyTags/123456789sample BigQuery policy tag added tocolumn1:

config {  type: "table",  columns: {    column1: {      description: "Some description",      bigqueryPolicyTags: ["projects/example-project/locations/us/taxonomies/123456789/policyTags/123456789"]    }  }}SELECT "test" AS column1

What's next

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-15 UTC.