Repository navigation
Commit fc79738
committed
fix(bigquery): keep the Arrow first page and wait without rows
When an ARROW query's results didn't fit in the jobs.query response,
QueryJob.result() dropped that response, because it only kept first
pages that had STRUCT_ENCODING rows. The stream then reread every row
from offset 0. While waiting for the job, query_and_wait() also passed
page_size to jobs.getQueryResults, which returned STRUCT_ENCODING rows
that ARROW results never use.
For ARROW queries, decide whether rows remain by comparing
pageRowCount with totalRows instead of checking for a pageToken, wait
with page_size=0 so jobs.getQueryResults is called with maxResults=0,
and keep a jobs.query response that has arrowRecordBatch as the first
page. RowIterator then returns the first page and streams the rest
from the next row, also when it's read again. Queries that don't use
ARROW are unchanged.1 parent aa55288 commit fc79738
7 files changed
Lines changed: 482 additions & 9 deletions
File tree
- packages/google-cloud-bigquery
- google/cloud/bigquery
- job
- tests
- system
- unit
- job
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
116 | 126 | | |
117 | 127 | | |
118 | 128 | | |
| |||
153 | 163 | | |
154 | 164 | | |
155 | 165 | | |
156 | | - | |
157 | 166 | | |
158 | 167 | | |
159 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
536 | 540 | | |
537 | 541 | | |
538 | 542 | | |
| |||
553 | 557 | | |
554 | 558 | | |
555 | 559 | | |
556 | | - | |
| 560 | + | |
557 | 561 | | |
558 | 562 | | |
559 | 563 | | |
| |||
616 | 620 | | |
617 | 621 | | |
618 | 622 | | |
| 623 | + | |
| 624 | + | |
619 | 625 | | |
620 | 626 | | |
621 | 627 | | |
| |||
627 | 633 | | |
628 | 634 | | |
629 | 635 | | |
630 | | - | |
| 636 | + | |
631 | 637 | | |
632 | 638 | | |
633 | 639 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1842 | 1842 | | |
1843 | 1843 | | |
1844 | 1844 | | |
1845 | | - | |
| 1845 | + | |
| 1846 | + | |
1846 | 1847 | | |
1847 | | - | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
1848 | 1852 | | |
1849 | 1853 | | |
1850 | 1854 | | |
| |||
0 commit comments