Skip to content

fix(bigquery): route JOB_CREATION_REQUIRED through fast query path#13437

Merged
jinseopkim0 merged 2 commits into
mainfrom
fix/fast-query-latency
Jun 17, 2026
Merged

fix(bigquery): route JOB_CREATION_REQUIRED through fast query path#13437
jinseopkim0 merged 2 commits into
mainfrom
fix/fast-query-latency

Conversation

@jinseopkim0

@jinseopkim0 jinseopkim0 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Routes queries under JobCreationMode.JOB_CREATION_REQUIRED to the fast query path (jobs.query API / 1 RPC) to avoid the slow fallback path (jobs.insert API / 2 RPCs).

https://docs.cloud.google.com/bigquery/docs/reference/rest/v2/jobs/query#QueryResponse says:

object (JobReference)

Reference to the 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).

If jobCreationMode was set to JOB_CREATION_OPTIONAL and the query completes without creating a job, this field will be empty.

Thus, routing JOB_CREATION_REQUIRED through the fast path is preferred.

b/522363981

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables fast query support when the job creation mode is set to JOB_CREATION_REQUIRED in QueryRequestInfo. This allows queries with this configuration to execute via the fast query path, returning a TableResult directly (with both JobId and QueryId populated) rather than creating a separate job. Unit and integration tests have been updated to reflect and verify this behavior. I have no feedback to provide.

@jinseopkim0 jinseopkim0 requested a review from lqiu96 June 11, 2026 18:34
@jinseopkim0 jinseopkim0 marked this pull request as ready for review June 11, 2026 18:34
@jinseopkim0 jinseopkim0 requested review from a team as code owners June 11, 2026 18:34
@jinseopkim0 jinseopkim0 requested a review from lqiu96 June 12, 2026 19:51
@jinseopkim0 jinseopkim0 merged commit 64cde7f into main Jun 17, 2026
193 checks passed
@jinseopkim0 jinseopkim0 deleted the fix/fast-query-latency branch June 17, 2026 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants