“Encountered an error while globbing file pattern” error when using BigQuery API w/ Google Sheets

后端 未结 1 479
醉酒成梦
醉酒成梦 2020-12-02 01:57

When trying the access a federated source (Google sheets) from BigQuery API, the following error is thrown:

[..]
 \"errorResult\" : {
      \"location\" : \"         


        
相关标签:
1条回答
  • 2020-12-02 02:30

    There are 3 steps to follow when allowing the API to query a federated table in BigQuery - which is pointing to a file in Drive i.e. Google Sheets.

    Two of the steps are documented here (I was missing the 2nd one - adding the Drive scope). The last one is the add the associated service account email that is being used to access the API to the file itself.

    1. Use the Google Cloud Platform Console to enable the Google Drive API for the project making the API call.
    2. Request the OAuth scope for Google Drive in addition to the scope for BigQuery.
    3. Add the service account email that you are using to the file in Drive. It looks something like <project-id>-<fingerprint-hash>@developer.gserviceaccount.com. "View" permission is enough.
    0 讨论(0)
提交回复
热议问题