Create table clones

This document describes how to copy a table to atable clone by using aCREATE TABLE CLONESQL statement, abq cpcommand, or ajobs.insertAPI call. This document is intended for users who are familiar withtable clones.

Permissions and roles

This section describes theIdentity and Access Management (IAM) permissionsthat you need to create a table clone, and thepredefined IAM rolesthat grant those permissions.

Permissions

To create a table clone, you need the following permissions:

PermissionResource
All of the following:

bigquery.tables.get
bigquery.tables.getData
The table that you want to make a clone of.
bigquery.tables.create
bigquery.tables.updateData
The dataset that contains the table clone.

Roles

The predefined BigQuery roles that provide the requiredpermissions are as follows:

RoleResource
Any of the following:

bigquery.dataViewer
bigquery.dataEditor
bigquery.dataOwner
bigquery.admin
The table that you want to make a clone of.
Any of the following:

bigquery.dataEditor
bigquery.dataOwner
bigquery.admin
The dataset that contains the new table clone.

Create a table clone

Use GoogleSQL, the bq command-line tool, or theBigQuery API to create a table clone.

SQL

To clone a table, use theCREATE TABLE CLONEstatement.

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

    Go to BigQuery

  2. In the query editor, enter the following statement:

    CREATETABLEmyproject.myDataset_backup.myTableCloneCLONEmyproject.myDataset.myTable;

  3. ClickRun.

For more information about how to run queries, seeRun an interactive query.

Replace the following:

  • PROJECT is the project ID of the target project.This project must be in the same organization as the project containingthe table you are cloning.
  • DATASET is the name of the target dataset.This dataset must be in the same region as the datasetcontaining the table you are cloning.
  • CLONE_NAME is name of the table clone that you arecreating.

bq

Use abq cp commandwith the--clone flag:

Go to Cloud Shell

bqcp--clone--no_clobberproject1:myDataset.myTablePROJECT:DATASET.CLONE_NAME

Replace the following:

  • PROJECT is the project ID of the target project.This project must be in the same organization as the projectcontaining the table you are cloning.
  • DATASET is the name of the target dataset.This dataset must be in the same region as the datasetcontaining the table you are cloning. If the dataset is not in the same region as the dataset containing the table you are cloning then a full table is copied.
  • CLONE_NAME is name of the table clone that you arecreating.

The--no_clobber flag is required.

If you are creating a clone in the same project as the base table, youcan skip specifying a project, as shown following:

bqcp--clone--no_clobbermyDataset.myTableDATASET.CLONE_NAME

API

Call thejobs.insert method with theoperationType field set toCLONE:

ParameterValue
projectIdThe project ID of the project that runs the job.
Request body
{"configuration":{"copy":{"sourceTables":[{"projectId":"myProject","datasetId":"myDataset","tableId":"myTable"}],"destinationTable":{"projectId":"PROJECT","datasetId":"DATASET","tableId":"CLONE_NAME"},"operationType":"CLONE","writeDisposition":"WRITE_EMPTY",}}}

Replace the following:

  • PROJECT is the project ID of the target project.This project must be in the same organization as the project containingthe table you are cloning.
  • DATASET is the name of the target dataset.This dataset must be in the same region as the datasetcontaining the table you are cloning. If the dataset is not in the same region as the dataset containing the table you are cloning a full table is copied.
  • CLONE_NAME is name of the table clone that you arecreating.

Access control

When you create a table clone, access to the table clone is set as follows:

  • Row-level access policies arecopied from the base table to the table clone.
  • Column-level access policiesare copied from the base table to the table clone.
  • Table-level access isdetermined as follows:

    • If the table clone overwrites an existing table, then the table-level accessfor the existing table is maintained.Tagsaren't copied from the base table.
    • If the table clone is a new resource, then the table-level access for thetable clone is determined by the access policies of the dataset in which thetable clone is created. Additionally,tags are copiedfrom the base table to the table clone.

What's next

  • After you create a table clone, you can use it like you use standard tables.For more information, seeManage tables.

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 2026-02-19 UTC.