Database Reference
In-Depth Information
"kind": "bigquery#dataset",
"etag": "\"4PTsVxg68bQkQs1RJ1Ndewqkgg4/
KOb9IHTeiiCy_ICxng0jrzYn6Zk\"",
"id": "bigquery-e2e:scratch",
"selfLink": "https://www.googleapis.com/bigquery/…",
"datasetReference": {
"datasetId": "scratch",
"projectId": "bigquery-e2e"
},
}
The first field you'll notice is kind , which, in this case, is
bigquery#dataset . The general pattern is that the kind is the API name
followed by the # sign followed by the resource type. This field is not
particularly interesting by itself because you usually know what object type
you're expecting. That said, it could make it easy to write code that handles
several different types of responses by inspecting the kind field.
The etag field is the next common field in the resource. This is a hash
of the resource object and can be useful for detecting when a resource
changes. The section titled “ETags and the If-None-Match Header” has
more information on how the etag field can be useful.
Next is the id field, which uniquely identifies the resource within that
collection. In BigQuery, there is always a reference field that is a better
way to refer to the resource. For this dataset, the id is
bigquery-e2e:application_logs . Although this name seems
straightforward, if you want to extract only the project ID portion, it can be
tricky to parse. The datasetReference field would help you here, since it
has the datasetId and projectId fields listed individually.
Finally, there is a selfLink field. This is a URI that you can use to read the
resource later. This tends to not be very useful; if you just read the object,
you probably already know which URL to use to get the object. However, it
can sometimes be useful as the result of a list operation, because it tells you
how to get the individual resource from the listing.
Search WWH ::




Custom Search