Next week we'll complete our overhaul of the BigQuery client (
cloud.google.com/go/bigquery). Most of the new surface is already in place, but we'll be removing the old code, resulting in many breaking changes.
We think these changes improve the library in a number of ways:
- It's much easier to find the operation you're interested in. Instead of a general Copy method, there are separate methods for loading, extracting, copying and querying.
- Modifying table metadata is simpler, requiring only one call.
- Iterators over rows and tables now follow the common iterator guidelines for the Go Cloud Client Libraries, so they look more like other iterators in these packages.
After these changes go in, we expect no more major breaking changes to the Go BigQuery client library. (We want to keep the door open to your feedback.)
Client.Copy and Client.Read
We'll be removing Client.Copy and Client.Read. Client.Copy supports loading, extracting, querying, and copying. Its replacements target each operation individually:
- Table.LoaderFrom constructs a Loader, which you can configure by setting its fields, and then call Run on to start a load job.
- Table.ExtractorTo does the same for extraction.
- Table.CopierFrom supports copying into a table from one or more other tables.
- Query has fields for configuration, as well as a Run method to start a query job.
These methods are already available.
As an example, instead of
We'll also remove Client.Read. Instead, use Table.Read to read directly from a table, or Job.Read to read from a query job. These methods are not yet available in their final form.
Table.Patch
We'll remove Table.Patch and the associated type TableMetadataPatch. They are replaced by the easier-to-use Table.Update method, which is already available.
For instance, instead of