There isn't any way to work with gzip in Google Apps Scripts right now - the UtilitiesApp.zip() method only uses regular zip compression, not gzip.
Rather than use the UrlFetchApp to form multipart uploads, why not use the BigQuery library that is present in Google Apps Scripts?
var projectId = "Bigquery-Project-Id";
var job = {
configuration: {
load: {
destinationTable: {
projectId: projectId,
datasetId: datasetId,
tableId: tableId
},
sourceFormat: "NEWLINE_DELIMITED_JSON",
writeDisposition: "WRITE_APPEND"
}
}
};
var data = jobData;
job = BigQuery.Jobs.insert(job, projectId, data);
To enable it, you will need to turn BigQuery access on in two places.
First, you need to go to the Resources drop down menu in the Apps UI, and then select Advanced Google Services... . Find Big Query on the list, and toggle the On/Off switch for it.
Before you close the advanced services window, you will need to click on the Google's Developer Console link at the bottom. This will open the developers console for your Google Apps Script project. Find Big Query on the APIs list in the console and enable it.
That's it - from there you can can pass data to the BigQuery API using the BigQuery Apps class, rather than UrlFetchApp.