PAD offers several methods for creating snapshots and moving data in bulk between datasets. Depending on whether you're working with static tables, views, or materialized views, you have a few options available. These range from simple point-and-click features in the UI to running lightweight code. Below are a couple of methods to accomplish your needs.
Static Tables: If you're looking to copy multiple static tables, BigQuery's Data Transfer Service is a fast, straightforward point-and-click solution. Here's how it works:
While logged into BigQuery, select the dataset or table you want to transfer.
Click the “Copy" button.
Choose the Destination Project, Dataset, and Table.
Hit the "Copy" button at the bottom to initiate the transfer.
Once the job has been executed, you can further modify it to run once, on-demand, or on a schedule. Please note that this method is only available for static tables, not views or materialized views.
For more information on Data Transfer Service, refer to Google's documentation here.
Static Tables, Views, & Materialized Views: Datasets often include a mix of static tables, views, and materialized views. Unfortunately, BigQuery’s UI doesn’t reliably copy views as static tables. However, you can use procedural SQL to “loop” through each table in a dataset—whether it’s a static table, view, or materialized view—and create static snapshots of them in bulk!
To do this, simply copy the code below, update your source and destination variables, and run it.
For more on procedural SQL, refer to Google’s documentation here.
Have questions? Contact us at help@techallies.org!
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article