{"record":{"id":"0e88a8ed13e0a618","repo":"apache/beam","slug":"no-such-table-tablename","errorCode":null,"errorMessage":"No such table: ${tableName}","messagePattern":"No such table: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/store/InMemoryMetaStore.java","lineNumber":67,"sourceCode":"  public void createTable(Table table) {\n    validateTableType(table);\n\n    // first assert the table name is unique\n    if (tables.containsKey(table.getName())) {\n      throw new IllegalArgumentException(\"Duplicate table name: \" + table.getName());\n    }\n\n    // invoke the provider's create\n    getProvider(table.getType()).createTable(table);\n\n    // store to the global metastore\n    tables.put(table.getName(), table);\n  }\n\n  @Override\n  public void dropTable(String tableName) {\n    if (!tables.containsKey(tableName)) {\n      throw new IllegalArgumentException(\"No such table: \" + tableName);\n    }\n\n    Table table = tables.get(tableName);\n    getProvider(table.getType()).dropTable(tableName);\n    tables.remove(tableName);\n  }\n\n  @Override\n  public Map<String, Table> getTables() {\n    return ImmutableMap.copyOf(tables);\n  }\n\n  @Override\n  public BeamSqlTable buildBeamSqlTable(Table table) {\n    TableProvider provider = getProvider(table.getType());\n\n    return provider.buildBeamSqlTable(table);\n  }","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/java/extensions/sql/src/main/java/org/apache/beam/sdk/extensions/sql/meta/store/InMemoryMetaStore.java#L49-L85","documentation":"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.","triggerScenarios":"Calling metaStore.dropTable(tableName) for a name that was never created, was already dropped, or differs in case/spelling from the registered name.","commonSituations":"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).","solutions":["Verify the exact table name with getTable(name) before dropping.","Make cleanup idempotent: skip the drop when the table is absent.","Create the table before attempting to drop it."],"exampleFix":"// before\nmetaStore.dropTable(\"orders\");\n// after\nif (metaStore.getTable(\"orders\") != null) {\n  metaStore.dropTable(\"orders\");\n}","handlingStrategy":"validation","validationCode":"if (metaStore.getTable(tableName) == null) return; // nothing to drop\nmetaStore.dropTable(tableName);","typeGuard":null,"tryCatchPattern":"try {\n  metaStore.dropTable(tableName);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"No such table\")) { /* idempotent teardown: ignore */ }\n}","preventionTips":["Write idempotent test teardown.","Track created table names in a set for cleanup.","Match table-name casing exactly."],"tags":["beam-sql","metastore","entity-not-found"],"backgroundTag":"record-not-found","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-20T03:17:13.778Z"}