apache/beam · error · IllegalArgumentException

No such table

Error message

No such table: ${tableName}

What it means

InMemoryMetaStore.dropTable throws IllegalArgumentException when the requested table name is not present in the metastore. The in-memory store requires an exact existing name before it can delegate the drop to the owning provider.

Solutions

  1. Verify the exact table name with getTable(name) before dropping.
  2. Make cleanup idempotent: skip the drop when the table is absent.
  3. Create the table before attempting to drop it.

Example fix

// before
metaStore.dropTable("orders");
// after
if (metaStore.getTable("orders") != null) {
  metaStore.dropTable("orders");
}
Defensive patterns

Strategy: validation

Validate before calling

if (metaStore.getTable(tableName) == null) return; // nothing to drop
metaStore.dropTable(tableName);

Try / catch

try {
  metaStore.dropTable(tableName);
} catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("No such table")) { /* idempotent teardown: ignore */ }
}

Prevention

When it happens

Trigger: Calling metaStore.dropTable(tableName) for a name that was never created, was already dropped, or differs in case/spelling from the registered name.

Common situations: Test teardown dropping tables in the wrong order or twice; name mismatches between DDL and cleanup code; assuming tables persisted across JVM restarts (they do not).

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


AI-assisted analysis of apache/beam@12126d8942 (2026-09-13). Data as JSON: /api/errors/0e88a8ed13e0a618. 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:67

  public void createTable(Table table) {
    validateTableType(table);

    // first assert the table name is unique
    if (tables.containsKey(table.getName())) {
      throw new IllegalArgumentException("Duplicate table name: " + table.getName());
    }

    // invoke the provider's create
    getProvider(table.getType()).createTable(table);

    // store to the global metastore
    tables.put(table.getName(), table);
  }

  @Override
  public void dropTable(String tableName) {
    if (!tables.containsKey(tableName)) {
      throw new IllegalArgumentException("No such table: " + tableName);
    }

    Table table = tables.get(tableName);
    getProvider(table.getType()).dropTable(tableName);
    tables.remove(tableName);
  }

  @Override
  public Map<String, Table> getTables() {
    return ImmutableMap.copyOf(tables);
  }

  @Override
  public BeamSqlTable buildBeamSqlTable(Table table) {
    TableProvider provider = getProvider(table.getType());

    return provider.buildBeamSqlTable(table);
  }

View on GitHub (pinned to 12126d8942)