apache/beam · error · IllegalArgumentException
No such table
Error message
No such table: ${name} What it means
InMemoryMetaStore.alterTable requires the named table to exist in the metastore before returning the provider's AlterTableOps; otherwise it throws IllegalArgumentException("No such table: ..."). It is the alter-path equivalent of the dropTable existence check.
Solutions
- Create the table before altering it.
- Check existence first: if (metaStore.getTable(name) != null) { metaStore.alterTable(name); }
- Fix the table name to match the registered one exactly.
Example fix
// before
metaStore.alterTable("orders").addFields(...);
// after
if (metaStore.getTable("orders") != null) {
metaStore.alterTable("orders").addFields(...);
} Defensive patterns
Strategy: validation
Validate before calling
if (metaStore.getTable(name) == null) {
throw new IllegalStateException("Cannot alter missing table: " + name);
}
metaStore.alterTable(name); Try / catch
try {
metaStore.alterTable(name).addFields(...);
} catch (IllegalArgumentException e) {
if (e.getMessage().startsWith("No such table")) { /* create first or fix name */ }
} Prevention
- Run schema-evolution scripts after table setup.
- Keep table names in shared constants.
- Check getTable(name) before any alter.
When it happens
Trigger: Calling metaStore.alterTable(name) for a table never created, already dropped, or with mismatched casing/spelling.
Common situations: Schema-evolution scripts running before table setup; renaming tables and forgetting to update alter calls; running ALTER against a fresh metastore in tests.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
- No such table
- Duplicate table name
- Duplicate table: from provider
- No TableProvider registered for table type
- Provider is already registered for table type
AI-assisted analysis of apache/beam@12126d8942 (2026-09-13).
Data as JSON: /api/errors/92e18d308401342d.
Report an issue: GitHub.
Appendix: source
Thrown at sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/store/InMemoryMetaStore.java:158
public TableProvider getProvider(String type) {
@Nullable TableProvider provider = providers.get(type.toLowerCase());
if (provider != null) {
return provider;
}
// check nested InMemoryMetaStore
provider = providers.get(getTableType());
if (provider != null && (provider instanceof InMemoryMetaStore)) {
return ((InMemoryMetaStore) provider).getProvider(type);
}
throw new IllegalStateException("No TableProvider registered for table type: " + type);
}
@Override
public AlterTableOps alterTable(String name) {
if (!tables.containsKey(name)) {
throw new IllegalArgumentException("No such table: " + name);
}
Table table = tables.get(name);
return getProvider(table.getType()).alterTable(name);
}
}
View on GitHub (pinned to 12126d8942)