Skip to content

[rust] Return TableNotExist for missing tables - #4271

Open
adamrecsko wants to merge 1 commit into
apache:mainfrom
adamrecsko:fix_get_table_table_not_found
Open

[rust] Return TableNotExist for missing tables#4271
adamrecsko wants to merge 1 commit into
apache:mainfrom
adamrecsko:fix_get_table_table_not_found

Conversation

@adamrecsko

Copy link
Copy Markdown

Generative AI disclosure

  • No generative AI tools used
  • Yes - OpenAI Codex

Purpose

Linked issue: close #4270

FlussConnection::get_table currently returns InvalidTableException when the requested table does not exist. This prevents callers from reliably distinguishing a
missing table from network, timeout, or other RPC failures.

This change makes get_table return FlussError::TableNotExist when the table is absent while preserving other errors unchanged.

Brief change log

  • Check whether the requested table exists before refreshing its metadata.
  • Return a typed TableNotExist error when the table is absent.
  • Preserve network and other RPC errors without converting them.
  • Add an integration test covering the error classification.

Tests

The following checks were run:

  • cargo fmt --all -- --check
  • RUST_TEST_THREADS=1 RUST_LOG=DEBUG RUST_BACKTRACE=full cargo test --features integration_tests --test test_fluss -p fluss-rs -- --nocapture

The new integration test passed:

  • test_get_nonexistent_table_returns_table_not_exist

Full integration-suite result:

  • 77 tests passed.
  • 5 filter-pushdown tests failed
  • These failures happen during statistics-enabled table creation and are unrelated to the get_table error-classification change.

API and Format

This change does not modify the public API, wire protocol, or storage format. It corrects the error code returned by the existing FlussConnection::get_table API.

Check table existence before refreshing its metadata so get_table
returns
  TableNotExist instead of InvalidTableException for a missing table.
  Add an integration test covering the expected error classification.
Fixes apache#4270
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.

[rust] get_table returns InvalidTableException for a nonexistent table

1 participant