Reputation: 1451
Currently I am getting a
Querying tables partitioned on a field is not supported in Legacy SQL
What can I do to use Legacy Sql to query a partitioned table?
Upvotes: 2
Views: 3530
Reputation: 334
In the apps script editor you have to state LegacySql to false
, for example:
var projectId = 'xxxxxxx';
var request = {
query: 'select * from project.database.table',
useLegacySql: false
};
var queryResults = BigQuery.Jobs.query(request, projectId);
Upvotes: 0
Reputation: 33745
What can I do to use Legacy Sql to query a partitioned table?
You can't use legacy SQL to query a partitioned table, as the error message says.
I'm using legacy SQL, because this is what our version of composer airflow is on now. airflow 1.9-composer
In most tools that don't provide an explicit option for the query dialect, you can use the #standardSQL
shebang, e.g.
#standardSQL
SELECT COUNT(*)
FROM dataset.partitioned_table
Upvotes: 2