Skip to content
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

docs: user-provided streamOrTableName for default write streams #1155

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

anguillanneuf
Copy link
Contributor

@anguillanneuf anguillanneuf commented Jun 29, 2021

Fixes a broken URL in a sample comment.

Also cleans up the docstrings for streamOrTableName in JsonStreamWriter.Builder.

IIUC, createDefaultStream can only be set to True on StreamWriter not JsonStreamWriter, the language below could mislead devs into thinking otherwise because it's not clear which builder it refers to.

* @param streamOrTableName name of the stream that must follow
* "projects/[^/]+/datasets/[^/]+/tables/[^/]+/streams/[^/]+" or if it is default stream
* (createDefaultStream is true on builder), then the name here should be a table name
* ""projects/[^/]+/datasets/[^/]+/tables/[^/]+"

Also it looks like _default is not added by client code but by the library.

private Builder(String streamOrTableName, TableSchema tableSchema, BigQueryWriteClient client) {
Matcher streamMatcher = streamPattern.matcher(streamOrTableName);
if (!streamMatcher.matches()) {
Matcher tableMatcher = tablePattern.matcher(streamOrTableName);
if (!tableMatcher.matches()) {
throw new IllegalArgumentException("Invalid name: " + streamOrTableName);
} else {
this.streamName = streamOrTableName + "/_default";

Not sure if I'm making all the right calls here. Thanks for reviewing!


Also see internal cl/381977832.

@anguillanneuf anguillanneuf requested review from a team and tswast June 29, 2021 16:49
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jun 29, 2021
@product-auto-label product-auto-label bot added the api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. label Jun 29, 2021
@stephaniewang526
Copy link
Contributor

Thank you!

@stephaniewang526 stephaniewang526 merged commit fc4a5c0 into master Jun 29, 2021
@stephaniewang526 stephaniewang526 deleted the default-stream branch June 29, 2021 17:55
gcf-merge-on-green bot pushed a commit that referenced this pull request Jun 30, 2021
🤖 I have created a release \*beep\* \*boop\*
---
### [1.22.6](https://www.github.com/googleapis/java-bigquerystorage/compare/v1.22.5...v1.22.6) (2021-06-30)


### Documentation

* **sample:** add IT for WriteToDefaultStream ([#1158](https://www.github.com/googleapis/java-bigquerystorage/issues/1158)) ([3280d7a](https://www.github.com/googleapis/java-bigquerystorage/commit/3280d7a0495a25f2509c9d4719439253e0fbaa5d)), closes [#1156](https://www.github.com/googleapis/java-bigquerystorage/issues/1156)
* user-provided streamOrTableName for default write streams ([#1155](https://www.github.com/googleapis/java-bigquerystorage/issues/1155)) ([fc4a5c0](https://www.github.com/googleapis/java-bigquerystorage/commit/fc4a5c061f51d83e41109ebf04f4202276410e30))


### Dependencies

* update dependency com.google.cloud:google-cloud-bigquery to v1.135.1 ([#1154](https://www.github.com/googleapis/java-bigquerystorage/issues/1154)) ([99f8ebb](https://www.github.com/googleapis/java-bigquerystorage/commit/99f8ebb2fde1fd86315a03dea5719e7a7744d081))
* update dependency com.google.cloud:google-cloud-shared-dependencies to v1.4.0 ([#1159](https://www.github.com/googleapis/java-bigquerystorage/issues/1159)) ([7e1b206](https://www.github.com/googleapis/java-bigquerystorage/commit/7e1b2062f8cb13c05270d86c9ff6863934e7478d))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
shubhwip pushed a commit to shubhwip/java-bigquerystorage that referenced this pull request Oct 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquerystorage Issues related to the googleapis/java-bigquerystorage API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants