Closed nateberkopec closed 9 years ago
This allows us to use this library for uploading data via the Jobs API.
json = StringIO.new json.write({ id: 1, name: "me" }.to_json) json.write("\n") json.rewind media = Google::APIClient::UploadIO.new(json, 'application/octet-stream') metadata = { "load": { "sourceFormat": "NEWLINE_DELIMITED_JSON", "destinationTable": { "projectId": "myproject", "datasetId": "mydata", "tableId": "mytable" } } } result = $bigquery.insert_job( metadata, { uploadType: 'multipart' }, media )
This allows us to use this library for uploading data via the Jobs API.