Posts

Showing posts from July, 2019

Query BigQuery conveniently with an Apps Script library

If you use Google Apps Script a lot, and particularly for working with BigQuery, then you might be interested in this library: BigQuery Helper . Just include the library's key "MjmmwOcqTeIFoRwuA8KZV5MtILCH4r83t" in your Apps Script script and you're ready to go! Why use my library? What this library does is it saves you from writing all of the "plumbing" code to interact with BigQuery. You can then concentrate on writing your query and any other code for manipulating the queried data. Increase your productivity! The Apps Script way – not productive! Apps Script's developer documentation for BigQuery has some sample code for working with BigQuery. But it forces you to write this code:   var queryResults = BigQuery.Jobs.query(request, projectId);   var jobId = queryResults.jobReference.jobId;   // Check on status of the Query Job.   var sleepTimeMs = 500;   while (!queryResults.jobComplete) {     Utilities.sleep(sleepTimeMs);  ...