Repository navigation
feat(bigquery): add LRO Poller for InsertJob - #6067
Conversation
There was a problem hiding this comment.
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
f4932d5 to
f1a8f64
Compare
InsertJobPoller for InsertJob
…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
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.
3461f39 to
da5aae4
Compare
da5aae4 to
c9fb4e2
Compare
c9fb4e2 to
45cb98e
Compare
Regenerate
google-cloud-bigquery-v2to introduce a standard.poller()method forInsertJob.