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
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.

None yet

2 participants