Skip to content

builder/stream_builder: validate UC three-part table name format in validate()#332

Open
Dev-X25874 wants to merge 2 commits into
databricks:mainfrom
Dev-X25874:fix/validate-table-name-format
Open

builder/stream_builder: validate UC three-part table name format in validate()#332
Dev-X25874 wants to merge 2 commits into
databricks:mainfrom
Dev-X25874:fix/validate-table-name-format

Conversation

@Dev-X25874
Copy link
Copy Markdown

@Dev-X25874 Dev-X25874 commented May 29, 2026

What changes are proposed in this pull request?

WHAT: StreamBuilder::validate() now checks that the table name follows the
required catalog.schema.table format, returning ZerobusError::InvalidTableName
immediately if it does not.

WHY: validate() previously only checked that the table name was non-empty.
A malformed name like "mytable" or "schema.table" would pass validate() and
build(), only to fail later inside the async OAuth token fetch — far from the
misconfigured builder. The three-part invariant was already enforced in
DefaultTokenFactory::parse_table_name; this PR moves that check to the earliest
possible point so the error fires synchronously, before any I/O occurs.

How is this tested?

Three unit tests added to the existing #[cfg(test)] block in stream_builder.rs:

  • validate_rejects_single_part_table_name
  • validate_rejects_two_part_table_name
  • validate_rejects_table_name_with_empty_part

All three fail on the original code and pass after the fix.

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.

1 participant