Commit 3aaedd1
committed
Fix chunk_total_present for paginated CloudFetch
The previous fix (checking chunkTotalPresent == 0 in closeCallback) only
worked for inline ArrowBatch results. For paginated CloudFetch (1 result
link per FetchResults call), telemetryUpdate set chunkTotalPresent = 1
on the first page, causing the closeCallback gate to never fire. The
final chunk_total_present would be 1 instead of the actual page count.
Fix: track actual S3 file downloads via cloudFetchFileCount (incremented
in cloudFetchCallback per file). closeCallback now sets chunk_total_present
from cloudFetchFileCount when CloudFetch was used, or from chunkCount for
inline ArrowBatch results. This correctly handles all three cases:
- Paginated CloudFetch (1 link/page): fileCount == pageCount == correct
- Bulk CloudFetch (all links in DirectResults): fileCount == S3 downloads
- Inline ArrowBatch: fileCount == 0, falls back to chunkCount
Also removes the now-incorrect early chunk_total_present setting from
telemetryUpdate (len(ResultLinks) per response is not the grand total for
paginated CloudFetch) and fixes the misleading comment in rows.go.
Co-authored-by: Isaac1 parent b084c59 commit 3aaedd1
2 files changed
Lines changed: 18 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
240 | 240 | | |
241 | 241 | | |
242 | 242 | | |
243 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
244 | 249 | | |
245 | 250 | | |
246 | 251 | | |
247 | | - | |
| 252 | + | |
248 | 253 | | |
249 | 254 | | |
250 | 255 | | |
| |||
265 | 270 | | |
266 | 271 | | |
267 | 272 | | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
| 273 | + | |
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
| 286 | + | |
286 | 287 | | |
287 | 288 | | |
288 | 289 | | |
| |||
306 | 307 | | |
307 | 308 | | |
308 | 309 | | |
309 | | - | |
310 | | - | |
311 | | - | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
312 | 318 | | |
313 | 319 | | |
314 | 320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
521 | 521 | | |
522 | 522 | | |
523 | 523 | | |
524 | | - | |
525 | | - | |
| 524 | + | |
526 | 525 | | |
527 | 526 | | |
528 | 527 | | |
| |||
0 commit comments