-
Notifications
You must be signed in to change notification settings - Fork 653
Closed
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.
Description
the REST API reference mentioned selectedFields [2], and all google cloud services support the fields parameter [3]; but from [1] I'm not seeing how can I pass these parameters?
- https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.6/bigquery/table?method=getMetadata
- https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/get
- https://developers.google.com/apis-explorer/#p/bigquery/v2/bigquery.tables.get
Background is we have some tens of thousands tables in bigquery want to figure out which ones are the most expensive ones (using the most storage), so write a little script to enumerate all table metadata, but it runs slow because each API call need to retrieve all metadata, want to use the fields to get only the needed information; if anyone knows a workaround, let me know.
(the http command here is an advanced version of curl; from https://httpie.org/)
$ access_token=$(gcloud auth application-default print-access-token)
$ http https://www.googleapis.com/bigquery/v2/projects/<projectId>/datasets/<datasetId>/tables/<tableId> \
fields==id,numBytes,numLongTermBytes,numRows,creationTime,expirationTime,lastModifiedTime,type,location \
access_token==$access_token
[...]
{
"id": "<projectId>:<datasetId>.<tableId>",
"numBytes": "112728076",
"numLongTermBytes": "0",
"numRows": "28431",
"creationTime": "1505962477264",
"expirationTime": "1513738477264",
"lastModifiedTime": "1505962477264",
"type": "TABLE",
"location": "US"
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: bigqueryIssues related to the BigQuery API.Issues related to the BigQuery API.