- HTTP request
- Path parameters
- Query parameters
- Request body
- Response body
- Authorization scopes
- Try it!
RPC to get the results of a query job.
HTTP request
GET https://bigquery.googleapis.com/bigquery/v2/projects/{projectId}/queries/{jobId}
The URL uses gRPC Transcoding syntax.
Path parameters
Parameters | |
---|---|
project |
Required. Project ID of the query job. |
job |
Required. Job ID of the query job. |
Query parameters
Parameters | |
---|---|
start |
Zero-based index of the starting row. |
page |
Page token, returned by a previous call, to request the next page of results. |
max |
Maximum number of results to read. |
timeout |
Optional: Specifies the maximum amount of time, in milliseconds, that the client is willing to wait for the query to complete. By default, this limit is 10 seconds (10,000 milliseconds). If the query is complete, the jobComplete field in the response is true. If the query has not yet completed, jobComplete is false. You can request a longer timeout period in the timeoutMs field. However, the call is not guaranteed to wait for the specified timeout; it typically returns after around 200 seconds (200,000 milliseconds), even if the query is not complete. If jobComplete is false, you can continue to wait for the query to complete by calling the getQueryResults method until the jobComplete field in the getQueryResults response is true. |
location |
The geographic location of the job. You must specify the location to run the job for the following scenarios:
For more information, see how to specify locations. |
format |
Optional. Output format adjustments. |
Request body
The request body must be empty.
Response body
Response object of jobs.getQueryResults.
If successful, the response body contains data with the following structure:
JSON representation |
---|
{ "kind": string, "etag": string, "schema": { object ( |
Fields | |
---|---|
kind |
The resource type of the response. |
etag |
A hash of this response. |
schema |
The schema of the results. Present only when the query completes successfully. |
job |
Reference to the BigQuery Job that was created to run the query. This field will be present even if the original request timed out, in which case jobs.getQueryResults can be used to read the results once the query has completed. Since this API only returns the first page of results, subsequent pages can be fetched via the same mechanism (jobs.getQueryResults). |
total |
The total number of rows in the complete query result set, which can be more than the number of rows in this single page of results. Present only when the query completes successfully. |
page |
A token used for paging results. When this token is non-empty, it indicates additional results are available. |
rows[] |
An object with as many results as can be contained within the maximum permitted reply size. To get any additional rows, you can call jobs.getQueryResults and specify the jobReference returned above. Present only when the query completes successfully. The REST-based representation of this data leverages a series of JSON f,v objects for indicating fields and values. |
total |
The total number of bytes processed for this query. |
job |
Whether the query has completed or not. If rows or totalRows are present, this will always be true. If this is false, totalRows will not be available. |
errors[] |
Output only. The first errors or warnings encountered during the running of the job. The final message includes the number of errors that caused the process to stop. Errors here do not necessarily mean that the job has completed or was unsuccessful. For more information about error messages, see Error messages. |
cache |
Whether the query result was fetched from the query cache. |
num |
Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE. |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/bigquery
https://www.googleapis.com/auth/cloud-platform
https://www.googleapis.com/auth/bigquery.readonly
https://www.googleapis.com/auth/cloud-platform.read-only
For more information, see the Authentication Overview.