Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BigQuery with Google Spreadsheet error 'Required parameter is missing'

UPDATE: This is the fix:

  var request = BigQuery.newQueryRequest();
  request.query = sql

  // Inserts a Query Job
  try {
    queryResults = BigQuery.Jobs.query(request,projectNumber);
  }
  catch (err) {
    Logger.log(err);
    Browser.msgBox(err);
    return;
  }

My BigQuery > Google Spreadsheet has been working fine until now, that I'm getting the error 'Required parameter is missing'

The line of code that is throwing the exception is:

  try {
    queryResults = BigQuery.Jobs.query(projectNumber, sql, {'timeoutMs':10000});
  }

The full code is in this tutorial.

https://developers.google.com/apps-script/articles/bigquery_tutorial#section2

Has this happened to anyone else? Have you find a solution to this?

like image 682
user2959920 Avatar asked Oct 20 '22 21:10

user2959920


2 Answers

Instead of this:

queryResults = BigQuery.Jobs.query(projectNumber, sql);

do this:

var bodyOrResource={
  "kind": "bigquery#queryRequest",
  "query": sql
}
queryResults = BigQuery.Jobs.query(bodyOrResource,projectNumber);
like image 126
JavaHelp4u Avatar answered Oct 29 '22 23:10

JavaHelp4u


There was a breaking change introduced in the Google internal version of appscript that should not affect external customers yet. If you are accessing BigQuery from outside of Google you should not experience this issue (yet).

like image 38
Jordan Tigani Avatar answered Oct 29 '22 23:10

Jordan Tigani