Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change: [BigQuery] only specify useLegacySQL is it's True #1421

Merged
merged 1 commit into from
Nov 22, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions redash/query_runner/big_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,11 @@ def _get_total_bytes_processed(self, jobs, query):
job_data = {
"query": query,
"dryRun": True,
"useLegacySql": not self.configuration.get('useStandardSql', False),
}

if self.configuration.get('useStandardSql', False):
job_data['useLegacySql'] = False

response = jobs.query(projectId=self._get_project_id(), body=job_data).execute()
return int(response["totalBytesProcessed"])

Expand All @@ -158,10 +161,13 @@ def _get_query_result(self, jobs, query):
"configuration": {
"query": {
"query": query,
"useLegacySql": not self.configuration.get('useStandardSql', False),
}
}
}

if self.configuration.get('useStandardSql', False):
job_data['configuration']['query']['useLegacySql'] = False


if "userDefinedFunctionResourceUri" in self.configuration:
resource_uris = self.configuration["userDefinedFunctionResourceUri"].split(',')
Expand Down