Skip to content

perf(bigquery): defer blocking jobs.get RPC in QueryPageFetcher until getNextPage() - #14650

Merged
lqiu96 merged 2 commits into
mainfrom
perf/bq-t1-15-lazy-jobs-get-pagination
Oct 14, 2026
Merged

lqiu96 merged 2 commits into
mainfrom
perf/bq-t1-15-lazy-jobs-get-pagination

Conversation

@lqiu96

@lqiu96 lqiu96 commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Defers the blocking jobs.get (getJob(jobId)) RPC in BigQueryImpl.QueryPageFetcher from its constructor to getNextPage(), and removes the unused Thread inheritance and 5-second status polling loop.

@lqiu96
lqiu96 requested review from a team as code owners October 13, 2026 21:07

@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 refactors QueryPageFetcher in BigQueryImpl to lazily resolve the destination table on the first call to getNextPage() instead of in the constructor. This optimization avoids an unnecessary blocking jobs.get RPC when only the first page of results is consumed. Additionally, the class no longer extends Thread and removes the historical polling loop since the job is already complete when the fetcher is instantiated. Null-safety is improved when checking job completion, and redundant variable assignments are cleaned up. Corresponding unit tests have been added to verify these optimizations. I have no feedback to provide on these changes.

@lqiu96
lqiu96 force-pushed the perf/bq-t1-15-lazy-jobs-get-pagination branch from 4b1750c to 302b1a9 Compare October 13, 2026 21:14

@jinseopkim0 jinseopkim0 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.

Please fix lint CI.

@lqiu96
lqiu96 enabled auto-merge (squash) October 14, 2026 02:05
@lqiu96
lqiu96 merged commit 6183b63 into main Oct 14, 2026
208 of 210 checks passed
@lqiu96
lqiu96 deleted the perf/bq-t1-15-lazy-jobs-get-pagination branch October 14, 2026 02:20
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.

2 participants