Fix _default stream path format for Java client compatibility#442
Open
asweet-confluent wants to merge 2 commits into
Open
Fix _default stream path format for Java client compatibility#442asweet-confluent wants to merge 2 commits into
asweet-confluent wants to merge 2 commits into
Conversation
The Java BigQuery client library sends the _default stream name as:
projects/{project}/datasets/{dataset}/tables/{table}/_default
But createDefaultStream only accepted the format with /streams/:
projects/{project}/datasets/{dataset}/tables/{table}/streams/_default
This caused GetWriteStream to fail with "unexpected stream id" when
called from Java clients, making the Storage Write API unusable.
Handle both path formats by checking for /streams/_default first,
then falling back to /_default.
Fixes goccy#246
Fixes goccy#342
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Tests that GetWriteStream works with both path formats for the
_default stream:
- projects/{p}/datasets/{d}/tables/{t}/streams/_default
- projects/{p}/datasets/{d}/tables/{t}/_default
The Java BigQuery client library uses the shorter format (without
/streams/), which was previously rejected by the emulator.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Java BigQuery client library sends the
_defaultstream name in this format:But
createDefaultStreamonly accepted the format with/streams/:This caused
GetWriteStreamto fail with"unexpected stream id"when called from Java (and likely other) clients, making the Storage Write API's default stream unusable with the emulator.Fix
Handle both path formats by checking for
/streams/_defaultfirst, then falling back to/_default.Testing
Tested end-to-end with the Confluent BigQuery Storage Sink Connector (Java) writing to the emulator via the Storage Write API's
_defaultstream. Before this fix, writes failed with:After this fix, writes succeed and rows are stored correctly.
Fixes #246
Fixes #342