-
Notifications
You must be signed in to change notification settings - Fork 85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: in StreamWriterV2, supports new append, which takes rows and offset #894
Conversation
…the connection and remove stream name and schema in the following ones.
…the connection and remove stream name and schema in the following ones
…va-bigquerystorage into schema-stream-name
Codecov Report
@@ Coverage Diff @@
## master #894 +/- ##
============================================
+ Coverage 80.91% 80.95% +0.03%
- Complexity 1017 1020 +3
============================================
Files 76 76
Lines 5518 5533 +15
Branches 425 427 +2
============================================
+ Hits 4465 4479 +14
Misses 880 880
- Partials 173 174 +1
Continue to review full report at Codecov.
|
public ApiFuture<AppendRowsResponse> append(ProtoRows rows, long offset) { | ||
// TODO: Move this check to builder after the other append is removed. | ||
if (this.writerSchema == null) { | ||
throw new StatusRuntimeException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be in at the writer builder for sure, here is not a proper place to validate this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. That's why I have a TODO here.
I need to put it here instead for backward compatibility reason. Otherwise, it would break existing customers. For example, the sample will stop working because the version is bumped up automatically.
I just need to do it in two phases.
if (this.writerSchema == null) { | ||
throw new StatusRuntimeException( | ||
Status.fromCode(Code.INVALID_ARGUMENT) | ||
.withDescription("Writer schema must be provided when building this writer.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this needs to be moved then no worries but otherwise, maybe we need to add a test for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
...-bigquerystorage/src/main/java/com/google/cloud/bigquery/storage/v1beta2/StreamWriterV2.java
Show resolved
Hide resolved
* @param offset the offset of the first row. | ||
* @return the append response wrapped in a future. | ||
*/ | ||
public ApiFuture<AppendRowsResponse> append(ProtoRows rows, long offset) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we simply accept byte strings?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think byte string is cleaner in this case. But since this builds with API anyway, I am fine with ProtoRows.
public ApiFuture<AppendRowsResponse> append(ProtoRows rows, long offset) { | ||
// TODO: Move this check to builder after the other append is removed. | ||
if (this.writerSchema == null) { | ||
throw new StatusRuntimeException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
🤖 I have created a release \*beep\* \*boop\* --- ## [1.13.0](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.12.0...v1.13.0) (2021-03-01) ### Features * **generator:** update protoc to v3.15.3 ([#898](https://www.github.com/googleapis/java-bigquerystorage/issues/898)) ([2f277d6](https://www.github.com/googleapis/java-bigquerystorage/commit/2f277d650e8f617c6253843baf73d5d220713a61)) * in StreamWriterV2, supports new append, which takes rows and offset ([#894](https://www.github.com/googleapis/java-bigquerystorage/issues/894)) ([f3865b0](https://www.github.com/googleapis/java-bigquerystorage/commit/f3865b06ea7c61e95d3ee9bc7b46857d9d3080cc)) * StreamWriterV2 will handle schema/streamName attachment ([#877](https://www.github.com/googleapis/java-bigquerystorage/issues/877)) ([c54bcfe](https://www.github.com/googleapis/java-bigquerystorage/commit/c54bcfec1706eef58eaf9dad8b49dc79fc8da133)) ### Dependencies * update dependency com.google.cloud:google-cloud-bigquery to v1.127.5 ([#896](https://www.github.com/googleapis/java-bigquerystorage/issues/896)) ([d211c76](https://www.github.com/googleapis/java-bigquerystorage/commit/d211c76dff747121d4560b55818c10bf595ef1c3)) * update dependency com.google.cloud:google-cloud-shared-dependencies to v0.20.0 ([#892](https://www.github.com/googleapis/java-bigquerystorage/issues/892)) ([438f1c3](https://www.github.com/googleapis/java-bigquerystorage/commit/438f1c3b551e6b97a3241c69f2006a5a6be78c4f)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
…en-plugin to v1.6.13 (googleapis#894)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly:
Fixes #<issue_number_goes_here> ☕️