0
votes

I would like to know how to set ReDash to use the new Standard SQL Bigquery's queries.

I understand that this can be done in BigQuery by removing the tick from "Legacy SQL". However, this option doesn't seem to be available or visible in ReDash.

According to BigQuery's documentation, I should add a flag to disable the Legacy SQL like this:

bq query --use_legacy_sql=false "SELECT word FROM publicdata.samples.shakespeare"

So, I assume that I need to change some parts of ReDash's source code.

Does someone know what parts of ReDash's source code needs to be modified? Or perhaps, this can be done differently?

I am using Re:dash 0.11.1+b2095 on Debian.

Thanks for your help.

3

3 Answers

2
votes

Support for Standard SQL is part of the next (0.12) release. You can already upgrade to the 0.12RC version or if you prefer to wait for the final release, you can just replace the BigQuery query runner implementation with the new one:

  1. Copy big_query.py from master to /opt/redash/current/redash/query_runner/big_query.py on your server (path might be different on your server).
  2. Restart all Redash services.
  3. Update your datasource configuration to use Standard SQL.

Btw, in the future, it's better to ask such questions on our forum. I found this question purely by chance...

0
votes

From the document: You can set useLegacySQL to false. There is sample code about java, python and php on the same page.

You can probably search from ReDash's codebase and found where they are using this API.

0
votes

It is also possible to force Standard SQL in most applications without code change. Just make sure that the first line of your query is

#StandardSQL

and BigQuery will treat the rest of the query as Standard SQL, i.e. the following would work:

#StandardSQL
SELECT [1,2,3]