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?