Database Reference
In-Depth Information
The TableData collection allows you to page through a consistent snapshot
of a table. The BigQuery Projects, Tables, Datasets, and Jobs collections give
a softer guarantee of consistency while paging. They never skip values if new
values arrive, but they might include values that arrive after paging starts.
The way this is done is that the pagination token describes the last value
returned; future list operations begin pagination at that value. You can tell
when you get to the end of the listing because you won't get a pageToken in
the response.
Updating Resources
The standard way to update a REST resource is the HTTP PUT verb. This
allows you to replace the entire object with a new one. Of course, there
may be rules governing which fields you are allowed to change—you can't
generally update a creation time of an object, for example.
The problem with updating an entire object is that it becomes easy to have a
race condition with another update operation. For example, if Alice updates
the table bigquery-e2e:logs.latest to add a description, and
meanwhile Bob is updating the same table to change the schema, either
Alice's or Bob's updates might be lost. Bob and Alice may have both read the
original copy, made their changes on that copy, and replaced the old version
with their new one. Whoever's update runs first will be overwritten by the
next update.
The way to prevent this type of race condition is to use the HTTP PATCH
verb. When using PATCH , you need to specify only the values you want
to change, not the entire resource. So Alice could specify just the table
description, and Bob could specify just the schema modification, and both
operations would complete successfully without the possibility of clobbering
each other.
In BigQuery, the only collections that support updates (via update or patch)
are Tables and Datasets. Update operations just modify metadata; they don't
modify data in the tables.
Response-Control Options
Some resources in Google APIs can be quite large; for instance, query Job
resources include the query text, which can be up to 100 kB. If you want to
list 10,000 jobs that all have 100 kB of queries, you might end up reading
Search WWH ::




Custom Search