Commit 64cde7f
authored
fix(bigquery): route JOB_CREATION_REQUIRED through fast query path (#13437)
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](https://docs.cloud.google.com/bigquery/docs/reference/rest/v2/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/5223639811 parent 7f4c73a commit 64cde7f
4 files changed
Lines changed: 66 additions & 9 deletions
File tree
- java-bigquery/google-cloud-bigquery/src
- main/java/com/google/cloud/bigquery
- test/java/com/google/cloud/bigquery
- it
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
| 90 | + | |
92 | 91 | | |
93 | 92 | | |
94 | 93 | | |
| |||
Lines changed: 51 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
2393 | 2394 | | |
2394 | 2395 | | |
2395 | 2396 | | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
| 2405 | + | |
| 2406 | + | |
| 2407 | + | |
| 2408 | + | |
| 2409 | + | |
| 2410 | + | |
| 2411 | + | |
| 2412 | + | |
| 2413 | + | |
| 2414 | + | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
| 2427 | + | |
| 2428 | + | |
| 2429 | + | |
| 2430 | + | |
| 2431 | + | |
| 2432 | + | |
| 2433 | + | |
| 2434 | + | |
| 2435 | + | |
| 2436 | + | |
| 2437 | + | |
| 2438 | + | |
| 2439 | + | |
| 2440 | + | |
| 2441 | + | |
| 2442 | + | |
| 2443 | + | |
| 2444 | + | |
| 2445 | + | |
| 2446 | + | |
2396 | 2447 | | |
2397 | 2448 | | |
2398 | 2449 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
162 | 169 | | |
163 | 170 | | |
164 | 171 | | |
165 | 172 | | |
166 | 173 | | |
167 | 174 | | |
168 | 175 | | |
| 176 | + | |
169 | 177 | | |
170 | 178 | | |
| 179 | + | |
171 | 180 | | |
172 | 181 | | |
173 | 182 | | |
| |||
java-bigquery/google-cloud-bigquery/src/test/java/com/google/cloud/bigquery/it/ITBigQueryTest.java
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7344 | 7344 | | |
7345 | 7345 | | |
7346 | 7346 | | |
7347 | | - | |
7348 | 7347 | | |
7349 | 7348 | | |
7350 | | - | |
| 7349 | + | |
7351 | 7350 | | |
7352 | 7351 | | |
7353 | 7352 | | |
| |||
7411 | 7410 | | |
7412 | 7411 | | |
7413 | 7412 | | |
7414 | | - | |
7415 | 7413 | | |
7416 | | - | |
| 7414 | + | |
7417 | 7415 | | |
7418 | 7416 | | |
7419 | 7417 | | |
| |||
7508 | 7506 | | |
7509 | 7507 | | |
7510 | 7508 | | |
7511 | | - | |
7512 | | - | |
| 7509 | + | |
7513 | 7510 | | |
7514 | 7511 | | |
7515 | 7512 | | |
7516 | 7513 | | |
7517 | 7514 | | |
7518 | | - | |
| 7515 | + | |
| 7516 | + | |
7519 | 7517 | | |
7520 | 7518 | | |
7521 | 7519 | | |
| |||
0 commit comments