feat: BigQuery Storage v1beta1 API migration guide - #13537
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a migration guide for transitioning the BigQuery Storage API from v1beta1 to v1 in Java. The guide outlines key changes and provides code comparisons for client initialization, session creation, and reading rows. Feedback is provided regarding an error in the code example for reading rows, where calling a method on a deprecated field would result in a compilation error rather than just a deprecation warning.
| * **Read Rows Request**: `StreamPosition` is flattened. You now pass the | ||
| stream name directly as `read_stream` and the `offset` as a top-level field | ||
| in `ReadRowsRequest`. | ||
|
|
There was a problem hiding this comment.
Would a quick reference table be useful?
### Class Mapping Quick Reference
| v1beta1 | v1 |
|---|---|
| `BigQueryStorageClient` | `BigQueryReadClient` |
| `TableReference` | `String` (Formatted table path) |
| `RequestedStreams` | `MaxStreamCount` |
| `ShardingStrategy` | *Removed* (Server-side handled) |
| `StreamPosition` | `String` (Stream name) + `Offset` |
|
|
||
| try (BigQueryStorageClient client = BigQueryStorageClient.create()) { | ||
| // use client | ||
| } |
There was a problem hiding this comment.
Suggest to update the client initialization to include a catch so the code compiles out-of-the-box, here and on the below example.
} catch (IOException e) {
// Handle client initialization failure
}
There was a problem hiding this comment.
Kef131
left a comment
There was a problem hiding this comment.
We can not handle pipelines and processes in google-cloud-java repo, please submit it in https://github.com/GoogleCloudPlatform/java-docs-samples
|
I've closed this PR and moved the change to GoogleCloudPlatform/java-docs-samples#10316 |
Fix b/505001153
BigQuery Storage team is planning to deprecate v1beta1 API. This PR adds a migration guide from v1beta1 to v1.