risingwavelabs/risingwave · error · InvalidInput
table "{table_name}" does not exist
Error message
table "{table_name}" does not exist What it means
Session::get_table (catalog access path) resolves a table by name within a schema and returns an eyelevel InvalidInput error when no created table with that name exists. It is the user-facing "table does not exist" error, raised before privilege checks run.
Source
Thrown at src/frontend/src/session.rs:1294
}
pub fn get_table_by_id(&self, table_id: TableId) -> Result<Arc<TableCatalog>> {
let catalog_reader = self.env().catalog_reader().read_guard();
Ok(catalog_reader.get_any_table_by_id(table_id)?.clone())
}
pub fn get_table_by_name(
&self,
table_name: &str,
db_id: DatabaseId,
schema_id: SchemaId,
) -> Result<Arc<TableCatalog>> {
let catalog_reader = self.env().catalog_reader().read_guard();
let table = catalog_reader
.get_schema_by_id(db_id, schema_id)?
.get_created_table_by_name(table_name)
.ok_or_else(|| {
Error::new(
ErrorKind::InvalidInput,
format!("table \"{}\" does not exist", table_name),
)
})?;
self.check_privileges(&[ObjectCheckItem::new(
table.owner(),
AclMode::Select,
table_name.to_owned(),
table.id,
)])?;
Ok(table.clone())
}
pub fn get_secret_by_name(
&self,
schema_name: Option<String>,View on GitHub (pinned to 6469eb736d)
Solutions
- Run SHOW TABLES IN <schema> to list exact table names.
- Fully qualify and quote the identifier: SELECT * FROM "db"."schema"."table".
- Verify the object exists in rw_catalog.rw_tables; if it's an MV/source, query it via the correct statement type.
- Recreate the table if it was dropped, or point the client at the correct database.
Example fix
// before let t = session.get_table(db_id, schema_id, "Orderes").await?; // typo // after let t = session.get_table(db_id, schema_id, "Orders").await?;
Defensive patterns
Strategy: validation
Validate before calling
-- before get_table
let exists = catalog_reader.get_schema_by_id(db_id, schema_id)?
.get_created_table_by_name(table_name).is_some();
if !exists { return Err(...); } Try / catch
match session.get_table(db_id, schema_id, name).await {
Ok(t) => t,
Err(e) if e.to_string().contains("does not exist") => {
create_or_recreate_table(name).await?;
session.get_table(db_id, schema_id, name).await?
}
Err(e) => return Err(e),
} Prevention
- Run SHOW TABLES before querying in scripts and CI.
- Use exact case-matched, quoted table names from catalog listings.
- Remember MVs/sources are not tables for this API — pick the right accessor.
- Handle concurrent DDL: re-check existence after 'does not exist' errors.
When it happens
Trigger: Calling APIs that fetch a TableCatalog by table_name for a given db_id/schema_id when get_created_table_by_name returns None: querying or altering a table that was never created, was dropped, or exists only as a source/view/index.
Common situations: Typo or wrong case in the table name; table dropped by another session; object is a source or MV, not a table; connecting to the wrong database; webhook/HTTP APIs referencing a table name that doesn't exist.
Related errors
- {object_type} not found: {name}
- {0}
- relative_error={} does not satisfy 0.0 < relative_error < 1.
- {} must contain 1 argument
- {object_type} named {name} already exists{}
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/63532221b5fe5bc6.
Report an issue: GitHub.