'Insert data into a bigquery table.
If the table specified doesn\'t exist, it will be created with the specified
schema.
Args:
table_id: string table id
fd: open file descriptor containing the newline separated JSON
schema: BigQuery schema dict
job_id: string job id
Returns:
API response object on success, None on failure'

def InsertData(self, table_id, fd, schema, job_id):

    configuration = {'schema': {'fields': schema}, 'destinationTable': {'projectId': self.project_id, 'tableId': table_id, 'datasetId': self.dataset_id}, 'sourceFormat': 'NEWLINE_DELIMITED_JSON'}
    body = {'configuration': {'load': configuration}, 'jobReference': {'projectId': self.project_id, 'jobId': job_id}}
    mediafile = http.MediaFileUpload(fd.name, mimetype='application/octet-stream')
    job = self.service.jobs().insert(projectId=self.project_id, body=body, media_body=mediafile)
    try:
        response = job.execute()
        return response
    except errors.HttpError as e:
        if self.GetDataset(self.dataset_id):
            logging.exception('Error    with    job:    %s', job_id)
        else:
            logging.info('Attempting    to    create    dataset:    %s', self.dataset_id)
            self.CreateDataset()
        return self.RetryUpload(job, job_id, e)
