I need to pass column names as parameters in standard SQL Bigquery so that I do not need to hard code the column names. How can I do that? I need to do something like :
@column_name = "Origin";
SELECT @column_name FROM table
I need to pass column names as parameters in standard SQL Bigquery so that I do not need to hard code the column names. How can I do that? I need to do something like :
@column_name = "Origin";
SELECT @column_name FROM table
As of April 2015, the answer seems to be:
There are no 'variables' to be set in BigQuery, but you could add a feature request.
From the same thread, it seems you can use Datalab to use Python variables with BigQuery.
Also, see this thread about using SQL API.