Skip to content

Copy

These functions enable copying of BigQuery resources (EXTERNAL TABLE, FUNCTION, TABLE FUNCTION, PROCEDURE), maintaining all options from the source resource, and updating all references from the source to the destination dataset.

Functions

copy_external_table

Attribute Value
Name copy_external_table
ID bqtools.[region].copy_external_table
Description Copies a single EXTERNAL TABLE from source to destination, maintaining all source table options.
Type PROCEDURE
Arguments source_table_id STRING, destination_table_id STRING
Returns None
Dependencies bqtools-qb.[region].copy_external_table

execution: copy_external_table

CALL bqtools.eu.copy_external_table(source_table_id, destination_table_id);
CALL bqtools.us.copy_external_table(source_table_id, destination_table_id);

copy_external_tables

Attribute Value
Name copy_external_tables
ID bqtools.[region].copy_external_tables
Description Copies all EXTERNAL TABLE resources from a source dataset to a destination dataset, maintaining all source table options and excluding specific tables if required.
Type PROCEDURE
Arguments source_dataset_id STRING, destination_dataset_id STRING, exclude_table_ids ARRAY<STRING>
Returns None
Dependencies bqtools.[region].get_external_table_ids, bqtools.[region].copy_external_table

execution: copy_external_tables

CALL bqtools.eu.copy_external_tables(source_dataset_id, destination_dataset_id, exclude_table_ids);
CALL bqtools.us.copy_external_tables(source_dataset_id, destination_dataset_id, exclude_table_ids);

copy_function

Attribute Value
Name copy_function
ID bqtools.[region].copy_function
Description Copies a single FUNCTION from source to destination, maintaining all source table options and updating all references from the source to the destination dataset.
Type PROCEDURE
Arguments source_function_id STRING, destination_function_id STRING
Returns None
Dependencies bqtools-qb.[region].copy_function

execution: copy_function

CALL bqtools.eu.copy_function(source_function_id, destination_function_id);
CALL bqtools.us.copy_function(source_function_id, destination_function_id);

copy_functions

Attribute Value
Name copy_functions
ID bqtools.[region].copy_functions
Description Copies all FUNCTION resources from a source dataset to a destination dataset, maintaining all source function options, updating all references from the source to the destination dataset and excluding specific functions if required.
Type PROCEDURE
Arguments source_dataset_id STRING, destination_dataset_id STRING, exclude_function_ids ARRAY<STRING>
Returns None
Dependencies bqtools.[region].get_function_ids, bqtools.[region].copy_function

execution: copy_functions

CALL bqtools.eu.copy_functions(source_dataset_id, destination_dataset_id, exclude_function_ids);
CALL bqtools.us.copy_functions(source_dataset_id, destination_dataset_id, exclude_function_ids);

copy_table_function

Attribute Value
Name copy_table_function
ID bqtools.[region].copy_table_function
Description Copies a single TABLE FUNCTION from source to destination, maintaining all source table function options and updating all references from the source to the destination dataset.
Type PROCEDURE
Arguments source_table_function_id STRING, destination_table_function_id STRING
Returns None
Dependencies bqtools-qb.[region].copy_table_function

execution: copy_table_function

CALL bqtools.eu.copy_table_function(source_table_function_id, destination_table_function_id);
CALL bqtools.us.copy_table_function(source_table_function_id, destination_table_function_id);

copy_table_functions

Attribute Value
Name copy_table_functions
ID bqtools.[region].copy_table_functions
Description Copies all TABLE FUNCTION resources from a source dataset to a destination dataset, maintaining all source table function options, updating all references from the source to the destination dataset and excluding specific functions if required.
Function Type PROCEDURE
Arguments source_dataset_id STRING, destination_dataset_id STRING, exclude_table_function_ids ARRAY<STRING>
Returns None
Dependencies bqtools.[region].get_function_ids, bqtools.[region].copy_function

execution: copy_table_functions

CALL bqtools.eu.copy_table_functions(source_dataset_id, destination_dataset_id, exclude_table_function_ids);
CALL bqtools.us.copy_table_functions(source_dataset_id, destination_dataset_id, exclude_table_function_ids);

copy_procedure

Attribute Value
Name copy_procedure
ID bqtools.[region].copy_procedure
Description Copies a single PROCEDURE from source to destination, maintaining all source table function options and updating all references from the source to the destination dataset.
Type PROCEDURE
Arguments source_procedure_id STRING, destination_procedure_id STRING
Returns None
Dependencies bqtools-qb.[region].copy_procedure

execution: copy_procedure

CALL bqtools.eu.copy_procedure(source_procedure_id, destination_procedure_id);
CALL bqtools.us.copy_procedure(source_procedure_id, destination_procedure_id);

copy_procedures

Attribute Value
Name copy_procedures
ID bqtools.[region].copy_procedure
Description Copies all PROCEDURE resources from a source dataset to a destination dataset, maintaining all source procedure options, updating all references from the source to the destination dataset and excluding specific procedures if required.
Type PROCEDURE
Arguments source_dataset_id STRING, destination_dataset_id STRING, exclude_procedure_ids ARRAY<STRING>
Returns None
Dependencies bqtools.[region].get_procedure_ids, bqtools.[region].copy_procedure

execution: copy_procedures

CALL bqtools.eu.copy_procedures(source_dataset_id, destination_dataset_id, exclude_procedure_ids);
CALL bqtools.us.copy_procedures(source_dataset_id, destination_dataset_id, exclude_procedure_ids);