Database Reference
In-Depth Information
u'destinationTable': {
u'datasetId':
u'_0e32b38e1117b2fcea992287c138bd53acfff7cc',
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'endTime': u'1394904326418',
u'query': {u'cacheHit': True,
u'totalBytesProcessed':
u'0'},
u'startTime': u'1394904326024',
u'totalBytesProcessed': u'0'},
u'status': {u'state': u'DONE'}}
The job looks similar, but is now in state DONE , and has a couple of extra
statistics values. You'll note that the table and dataset IDs are long
unintelligible strings; these values describe an automatically created table to
hold the query results. Now that the job is complete, you can read the results
by calling TableData.list() with the table ID returned by the job:
>>> table_ref =
response['configuration']['query']['destinationTable']
>>> results =
service.tabledata().list(**table_ref).execute()
>>> pprint.pprint(results)
{u'etag': u'"Ny_MVtklP3Cn04wt1Sr9PinHZEI/
dXCj1HevhJ0HiCBv_gB0LRPFaDE"',
u'kind': u'bigquery#tableDataList',
Search WWH ::




Custom Search