Database Reference
In-Depth Information
u'projectId': u'bigquery-e2e',
u'tableId':
u'anon5c03da1f543a2486eca295f285b40eb87b01ea84'
},
u'query': u'SELECT 17',
u'writeDisposition': u'WRITE_TRUNCATE'}},
u'etag': u'"Ny_MVtklP3Cn04wt1Sr9PinHZEI/
jqd_3fxcej4s3YkUyZl--c8JK88"',
u'id': u'bigquery-e2e:job_1394904041084',
u'jobReference': {u'jobId': u'job_1394904041084',
u'projectId': u'bigquery-e2e'},
u'kind': u'bigquery#job',
u'selfLink': u'https://www.googleapis.com/bigquery/…',
u'statistics': {u'creationTime': u'1394904325715',
u'startTime': u'1394904326024'},
u'status': {u'state': u'RUNNING'}}
However, if you look at the output of Jobs.insert() , you can notice two
things: You don't get any query results, and the job is still in the RUNNING
state. Before you can get query results, you need to wait for the job to
complete. You can do this by calling Jobs.get() with the job ID from the
original request:
>>> response = service.jobs().get(projectId=project_id ,
jobId=job_id).execute()
You can use a Python trick to avoid having to pass parameters individually,
by using the ** operator to turn a Python dict into named parameters. The
following command is identical to the previous one, but saves some typing:
>>> response =
service.jobs().get(**response['jobReference']).execute()
Here is what the resulting Job resource looks like:
>>> pprint.pprint(response)
{u'configuration': {
u'query': {
u'createDisposition': u'CREATE_IF_NEEDED',
Search WWH ::




Custom Search