Skip to content
This repository was archived by the owner on Feb 24, 2026. It is now read-only.

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

Merged
stephaniewang526 merged 3 commits intomasterfrom
default-stream
Jun 29, 2021
Merged

docs: user-provided streamOrTableName for default write streams#1155
stephaniewang526 merged 3 commits intomasterfrom
default-stream

Conversation

@anguillanneuf
Copy link
Copy Markdown
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
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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