You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@fluss.apache.org by "adamrecsko (via GitHub)" <gi...@apache.org> on 2026/09/09 14:25:00 UTC
[I] [rust] get_table returns InvalidTableException for a nonexistent table [fluss]
adamrecsko opened a new issue, #4270:
URL: https://github.com/apache/fluss/issues/4270
### Search before asking
- [x] I searched in the [issues](https://github.com/apache/fluss/issues) and found nothing similar.
### Fluss version
main (development)
### Please describe the bug 🐞
When the Rust client calls `FlussConnection::get_table` for a table that does not exist, it returns the generic `InvalidTableException` instead of `TableNotExist`.
This prevents applications from reliably distinguishing a missing table from other metadata or network-related failures.
### Expected behavior
- A nonexistent table returns `FlussError::TableNotExist`.
- Network, timeout, and other RPC errors retain their original error type.
### Steps to reproduce
```rust
let table_path = TablePath::new("fluss", "nonexistent_table");
let result = connection.get_table(&table_path).await;
let error = match result {
Ok(_) => panic!("getting a nonexistent table should fail"),
Err(error) => error,
};
assert_eq!(
error.api_error(),
Some(FlussError::TableNotExist)
);
```
### Actual result
FlussError::InvalidTableException
### Expected result
FlussError::TableNotExist
### Solution
Before refreshing the table metadata, use the authoritative GetTable RPC to check whether the table exists.
If `GetTable` indicates that the table does not exist, return a typed `Error::table_not_exist` error. Propagate all other RPC and network errors unchanged.
Conceptually:
```rust
if metadata.fetch_table_id(table_path).await?.is_none() {
return Err(Error::table_not_exist(format!(
"Table not found: {table_path}"
)));
}
metadata.update_table_metadata(table_path).await?;
```
This preserves the distinction between a missing table and transient network or server failures.
Add an integration test verifying that `FlussConnection::get_table` returns `FlussError::TableNotExist` for a nonexistent table.
### Are you willing to submit a PR?
- [x] I'm willing to submit a PR!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@fluss.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org