Skip to content

[rust] Return error when table descriptor schema is missing. - #4175

Merged
fresh-borzoni merged 1 commit into
apache:mainfrom
slfan1989:fluss-4173
Sep 1, 2026
Merged

[rust] Return error when table descriptor schema is missing.#4175
fresh-borzoni merged 1 commit into
apache:mainfrom
slfan1989:fluss-4173

Conversation

@slfan1989

Copy link
Copy Markdown
Contributor

Purpose

Linked issue: close #4173

TableDescriptorBuilder::build() returns a Result<TableDescriptor>, but currently panics when the required schema is not set.

This change makes the builder return Error::IllegalArgument instead, allowing callers to handle the invalid builder state through the existing Result API.

Brief change log

  • Replace the expect() call in TableDescriptorBuilder::build() with an IllegalArgument error.
  • Add a unit test verifying that building a table descriptor without a schema returns the expected error.
  • Preserve the existing public method signature and successful build behavior.

Tests

  • Added metadata::table::tests::table_descriptor_builder_requires_schema.

API and Format

No.

Documentation

No.

@fresh-borzoni fresh-borzoni left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@slfan1989 Thx, LGTM 👍

@fresh-borzoni
fresh-borzoni merged commit c6210f4 into apache:main Sep 1, 2026
21 checks passed
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.

[Bug][Rust] TableDescriptorBuilder::build panics when schema is missing

2 participants