5

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?

2 Answers2

2

Instead of this:

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

do this:

var bodyOrResource={
  "kind": "bigquery#queryRequest",
  "query": sql
}
queryResults = BigQuery.Jobs.query(bodyOrResource,projectNumber);
JavaHelp4u
  • 3,477
  • 1
  • 13
  • 4
1

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).

Jordan Tigani
  • 26,089
  • 4
  • 60
  • 63
  • More details at: http://googleappsdeveloper.blogspot.co.uk/2013/11/code-updates-required-for-apps-script.html – Felipe Hoffa Nov 12 '13 at 14:43
  • Jordan, can you include the fix in your answer? On the surface, the question looks like it has no solution. Thanks Felipe. – Rohit May 08 '14 at 06:49
  • or a more thorough example, take a look at: https://code.google.com/p/bigquery-e2e/source/browse/samples/ch12/query.gs – Jordan Tigani May 08 '14 at 16:51