BigQuery is using Legacy SQL instead of Standard SQL despite us sending a JSON payload using the flag "useLegacySQL: False". Standard SQL is getting rejected - but the system will accept Legacy SQL with our JSON below.
As far as we can tell we are following BigQuery's documentation. What do we need to get BigQuery to use Standard SQL with this API call?
Here is our BigQuery JSON payload:
{
'jobReference': {
'jobId': '####',
'projectId': 'healthlabs-4'
},
'configuration': {
'query': {
'destinationTable': {
'tableId': u 'our_table_name',
'datasetId': 'our_dataset_id',
'projectId': 'our_project_id'
},
'useLegacySQL': False,
'priority': 'INTERACTIVE',
'query': u "SELECT ... FROM our_table WHERE ... GROUP BY ... ORDER BY ...",
'allowLargeResults': True
}
}
}
We can tell the query is rejected from the returning message from BigQuery which accepts our Legacy SQL but rejects our Standard SQL with this error :
{'create_table_error': [{u'location': u'query', u'message': u'Encountered " "FROM" "FROM "" at line 1, column 333.\nWas expecting:\n ")" ...\n ', u'reason': u'invalidQuery'}], 'bq_table_exists': 'no'}