GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — getMetadata: allow arbitrary request parameters · Issue #11 · googleapis/nodejs-bigquery

This repository was archived by the owner on Feb 7, 2026. It is now read-only.
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

getMetadata: allow arbitrary request parameters #11

Copy link
Copy link
Closed
Closed
getMetadata: allow arbitrary request parameters#11
Copy link
Assignees
callmehiphop
Labels
api: bigqueryIssues related to the googleapis/nodejs-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Description

@stephenplusplus
stephenplusplus
opened on Nov 17, 2017
Issue body actions

From @c0b on October 20, 2017 5:49

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?

  1. https://googlecloudplatform.github.io/google-cloud-node/#/docs/bigquery/0.9.6/bigquery/table?method=getMetadata
  2. https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/get
  3. 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"
}

Copied from original issue: googleapis/google-cloud-node#2684

Activity

  1. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    ContributorAuthor
    More actions

    From @c0b on October 20, 2017 6:58

    I see the fields parameter is the use case to mitigate the problem resolved by GraphQL API, but is it possible to ask google services to have GraphQL API?

  2. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    ContributorAuthor
    More actions

    From @callmehiphop on November 1, 2017 18:21

    @stephenplusplus I don't think it is very common for get/getMetadata to accept query parameters, however do you think we should add support for this in the common library?

  3. stephenplusplus
    added
    api: bigquery
    type: enhancement
    on Nov 17, 2017
  4. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    ContributorAuthor
    More actions

    I do! Best to be as raw as possible in the common layer.

  5. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    ContributorAuthor
    More actions

    From @tejohnso on November 2, 2017 22:41

    @c0b have you tried eg getMetadata({fields: "lastModifiedTime"})?
    It works in the storage module.

  6. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    ContributorAuthor
    More actions

    From @c0b on November 3, 2017 20:29

    no; I did try that do not work in @google-cloud/[email protected]; current getMetadata take one parameter only which is expected to be the callback function, if pass in an obj then the error is TypeError: callback is not a function

  7. stephenplusplus commented on Nov 17, 2017

    @stephenplusplus
    stephenplusplus
    on Nov 17, 2017
    ContributorAuthor
    More actions

    From @c0b on November 3, 2017 21:46

    @tejohnso the storage module works because of #2626 storage has its own repo that has support of that

    https://github.com/googleapis/nodejs-storage/search?q=getMetadata+path:src

  8. stephenplusplus
    removed
    api: bigquery
    on Dec 12, 2017
  9. JustinBeckwith
    added
    type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.
    and removed
    type: enhancement
    on Dec 22, 2018
  10. callmehiphop commented on Jul 15, 2019

    @callmehiphop
    callmehiphop
    on Jul 15, 2019
    Contributor
    More actions

    I think this has since been resolved in the common repo. If anyone has any issues trying to send parameters via getMetadata methods, please let us know and we'll re-open!

  11. callmehiphop
    closed this as completedon Jul 15, 2019
  12. gcf-label-sync
    added
    api: bigqueryIssues related to the googleapis/nodejs-bigquery API.
    on Jan 31, 2020
  13. JustinBeckwith
    assigned
    callmehiphop
    on Feb 1, 2021
  14. chalmerlowe
    added 2 commits that reference this issue on Jan 26, 2026

    test: add ci.yaml to owlbot.py excludes list

    cb226ee

    test: add ci.yaml to owlbot.py excludes list (#1594)

    5284cc5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @callmehiphop
    callmehiphop

Labels

api: bigqueryIssues related to the googleapis/nodejs-bigquery API.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.