Skip to content

Fix _default stream path format for Java client compatibility#442

Open
asweet-confluent wants to merge 2 commits into
goccy:mainfrom
asweet-confluent:fix-default-stream-path
Open

Fix _default stream path format for Java client compatibility#442
asweet-confluent wants to merge 2 commits into
goccy:mainfrom
asweet-confluent:fix-default-stream-path

Conversation

@asweet-confluent

Copy link
Copy Markdown

Summary

The Java BigQuery client library sends the _default stream name in this format:

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 (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/_default first, 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 _default stream. Before this fix, writes failed with:

UNKNOWN: failed to find stream from projects/test/datasets/my_dataset/tables/my_table/_default

After this fix, writes succeed and rows are stored correctly.

Fixes #246
Fixes #342

asweet-confluent and others added 2 commits March 27, 2026 12:58
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

_default WriteStream not supported Storage Write API functionality doesn't work - UNKNOWN: failed to find stream

1 participant