Skip to content

feat(bigquery): add LRO Poller for InsertJob - #6067

Merged
haphungw merged 7 commits into
googleapis:mainfrom
haphungw:bq-jobs-lro-builder-fix
Jul 17, 2026
Merged

haphungw merged 7 commits into
googleapis:mainfrom
haphungw:bq-jobs-lro-builder-fix

Conversation

@haphungw

Copy link
Copy Markdown
Contributor

Regenerate google-cloud-bigquery-v2 to introduce a standard .poller() method for InsertJob.

@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 adds support for long-running operations (LRO) in the BigQuery v2 client by introducing the 'google-cloud-lro' dependency, implementing the 'DiscoveryOperation' trait for 'Job' in a new 'operation' module, and adding a 'poller' method to the 'InsertJob' builder. The review feedback points out a critical issue where BigQuery jobs created without an explicit location will fail during polling because the poller does not dynamically capture the assigned location from the initial job creation response. A solution using 'Arc<Mutex<Option>>' to share the location between the start and query closures is suggested.

@codecov

codecov Bot commented Jul 15, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.01%. Comparing base (604812b) to head (92109ab).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6067      +/-   ##
==========================================
- Coverage   97.02%   97.01%   -0.01%     
==========================================
  Files         253      253              
  Lines       63547    63547              
==========================================
- Hits        61658    61653       -5     
- Misses       1889     1894       +5     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@haphungw
haphungw force-pushed the bq-jobs-lro-builder-fix branch from f4932d5 to f1a8f64 Compare July 15, 2026 22:32
@haphungw haphungw changed the title feat(bigquery): add LRO poller for InsertJob feat(bigquery): add LRO Poller for InsertJob Jul 15, 2026
@haphungw
haphungw marked this pull request as ready for review July 15, 2026 22:59
@haphungw
haphungw requested review from a team as code owners July 15, 2026 22:59
haphungw added a commit to googleapis/librarian that referenced this pull request Jul 16, 2026
…6841)

Add a core implementation of `lro::Poller` for BigQuery `InsertJob`. 

This maps the custom BQ REST job methods into the standard `lro::Poller`
interface.

Staged @ googleapis/google-cloud-rust#6067
haphungw added 3 commits July 16, 2026 18:11
When a BigQuery Job is created, the server may populate the job_reference.location
field in the response even if it wasn't specified in the original request.
For subsequent LRO polling calls (e.g. GetJob), the location might be required.
This commit uses a shared OnceLock to capture the location returned from the
initial start call and provides it to the query closure, ensuring that subsequent
polling requests use the correct location.
@haphungw
haphungw force-pushed the bq-jobs-lro-builder-fix branch from c9fb4e2 to 45cb98e Compare July 16, 2026 20:56
@haphungw
haphungw requested a review from dbolduc July 17, 2026 17:29

@dbolduc dbolduc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@haphungw
haphungw enabled auto-merge (squash) July 17, 2026 18:13
@haphungw
haphungw merged commit b8df7a3 into googleapis:main Jul 17, 2026
41 checks passed
@haphungw
haphungw deleted the bq-jobs-lro-builder-fix branch July 17, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the BigQuery API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants