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.
| ServerStream<ReadRowsResponse> stream = client.readRowsCallable().call(readRowsRequest); | ||
| for (ReadRowsResponse response : stream) { | ||
| // Process response.getAvroRows() | ||
| // Note: Prefer using response.getRowCount() over response.getAvroRows().getRowCount() (deprecated) |
There was a problem hiding this comment.
In the v1 API, the AvroRows message does not contain a row_count field (it was removed entirely, not just deprecated). Therefore, attempting to call response.getAvroRows().getRowCount() will result in a compilation error. The comment should be updated to clarify that row_count has been moved to ReadRowsResponse and is no longer available on AvroRows.
| // Note: Prefer using response.getRowCount() over response.getAvroRows().getRowCount() (deprecated) | |
| // Note: Use response.getRowCount() to retrieve the row count, as row_count is no longer available on AvroRows in v1. |
Fix b/505001153
BigQuery Storage team is planning to deprecate v1beta1 API. This PR adds a migration guide from v1beta1 to v1.