0

I got this error response when I called BigQuery API for the file in Spreadsheets.

Error: {
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "jobInternalError",
    "message": "The job encountered an internal error during execution and was unable to complete successfully."
   }
  ],
  "code": 400,
  "message": "The job encountered an internal error during execution and was unable to complete successfully."
 }
}

I called the API in a python program, like:

credentials = ServiceAccountCredentials.from_json_keyfile_name(
    KEYFILE,
    scopes=[
        'https://www.googleapis.com/auth/bigquery',
        'https://www.googleapis.com/auth/drive',
    ])
http_auth = credentials.authorize(httplib2.Http())
self.bigquery_service = build('bigquery', 'v2', http=http_auth)
query_response = self.bigquery_service.jobs().query(
    projectId=PROJECT_ID,
    body={'query': 'select * from <table-from-spreadsheet>'}
).execute()

I got no error when I tried the same query and scopes with Web UI under this document, or queried for the table in BigQuery.

What's wrong with my program?

pall
  • 56
  • 1
  • 6
  • make sure you've done all 3 steps here -> http://stackoverflow.com/questions/40731823/encountered-an-error-while-globbing-file-pattern-error-when-using-bigquery-api – Graham Polley Jan 27 '17 at 11:56
  • I was missing the 3rd step! After I share my spreadsheet with my service account, I can access it through BigQuery. Thank you so much! – pall Jan 30 '17 at 01:42

0 Answers0