jobs

GET /projects/{projectsId}/queries/{queriesId}

Changed on

RPC to get the results of a query job. # IAM Permissions Requires the following IAM permission(s) to use this method: - bigquery.jobs.get on the job. - bigquery.tables.getData on the destination table. If the user matches the creator of the job, the following IAM permission(s) are required instead: - bigquery.jobs.create on the project. - bigquery.tables.getData on the destination table.

Request

  • Base URL
    https://bigquery.googleapis.com/bigquery/v2
  • Auth
    • OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/bigquery
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/bigquery
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/cloud-platform
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/cloud-platform
    • or OAuth 2 and OAuth 2
      Implicit: https://accounts.google.com/o/oauth2/auth
      Scopes: https://www.googleapis.com/auth/cloud-platform.read-only
      Authorization code: https://accounts.google.com/o/oauth2/auth
      Token URL: https://accounts.google.com/o/oauth2/token scopes: https://www.googleapis.com/auth/cloud-platform.read-only

Path parameters

projectsIdstring required
queriesIdstring required

Query parameters

formatOptions.timestampOutputFormat'TIMESTAMP_OUTPUT_FORMAT_UNSPECIFIED' | 'FLOAT64' | 'INT64' | 'ISO8601_STRING'

Optional. The API output format for a timestamp. This offers more explicit control over the timestamp output format as compared to the existing use_int64_timestamp option.

formatOptions.useInt64Timestampboolean

Optional. Output timestamp as usec int64. Default is false.

locationstring

The geographic location of the job. You must specify the location to run the job for the following scenarios: * If the location to run a job is not in the us or the eu multi-regional location * If the job's location is in a single region (for example, us-central1) For more information, see how to specify locations.

maxResultsinteger

Maximum number of results to read.

pageTokenstring

Page token, returned by a previous call, to request the next page of results.

startIndexstring uint64

Zero-based index of the starting row.

timeoutMsinteger

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.

Response

Successful response

cacheHitboolean

Whether the query result was fetched from the query cache.

etagstring

A hash of this response.

jobCompleteboolean

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.

kindstring

The resource type of the response.

numDmlAffectedRowsstring int64

Output only. The number of rows affected by a DML statement. Present only for DML statements INSERT, UPDATE or DELETE.

pageTokenstring

A token used for paging results. When this token is non-empty, it indicates additional results are available.

totalBytesProcessedstring int64

The total number of bytes processed for this query.

totalRowsstring uint64

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.

Changes

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform.read-only was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform.read-only was removed from the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/bigquery was added to the endpoint's security scheme Oauth2c

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform.read-only was removed from the endpoint's security scheme Oauth2

    • info

      the security scope https://www.googleapis.com/auth/cloud-platform.read-only was removed from the endpoint's security scheme Oauth2c