{"record":{"id":"9e5f7292774f2295","repo":"apache/iceberg","slug":"table-does-not-exist-s-9e5f72","errorCode":null,"errorMessage":"Table does not exist: %s","messagePattern":"Table does not exist: (.+?)","errorType":"exception","errorClass":"NoSuchTableException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java","lineNumber":361,"sourceCode":"    return fetch(\n        row ->\n            JdbcUtil.stringToTableIdentifier(\n                row.getString(JdbcUtil.TABLE_NAMESPACE), row.getString(JdbcUtil.TABLE_NAME)),\n        (schemaVersion == JdbcUtil.SchemaVersion.V1)\n            ? JdbcUtil.V1_LIST_TABLE_SQL\n            : JdbcUtil.V0_LIST_TABLE_SQL,\n        catalogName,\n        JdbcUtil.namespaceToString(namespace));\n  }\n\n  @Override\n  public void renameTable(TableIdentifier from, TableIdentifier to) {\n    if (from.equals(to)) {\n      return;\n    }\n\n    if (!tableExists(from)) {\n      throw new NoSuchTableException(\"Table does not exist: %s\", from);\n    }\n\n    if (!namespaceExists(to.namespace())) {\n      throw new NoSuchNamespaceException(\"Namespace does not exist: %s\", to.namespace());\n    }\n\n    if (schemaVersion == JdbcUtil.SchemaVersion.V1 && viewExists(to)) {\n      throw new AlreadyExistsException(\"Cannot rename %s to %s. View already exists\", from, to);\n    }\n\n    if (tableExists(to)) {\n      throw new AlreadyExistsException(\"Table already exists: %s\", to);\n    }\n\n    int updatedRecords =\n        execute(\n            err -> {\n              if (JdbcUtil.isConstraintViolation(err)) {","sourceCodeStart":343,"sourceCodeEnd":379,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/core/src/main/java/org/apache/iceberg/jdbc/JdbcCatalog.java#L343-L379","documentation":"NoSuchTableException thrown by JdbcCatalog.renameTable when the source table does not exist in the iceberg_catalog table. The rename is rejected up-front via tableExists(from) so no rows are updated for a nonexistent source.","triggerScenarios":"Calling catalog.renameTable(from, to) where `from` was already dropped, was never created, is registered under a different name/case, or lives in a different catalog/database than the one being used.","commonSituations":"Double-rename or retry after a successful rename, typos in the fully-qualified table name, pointing the catalog at the wrong JDBC database, or app code assuming a table created by another job already exists.","solutions":["Verify the source table exists with catalog.tableExists(from) before renaming","Check the exact table identifier (namespace and name, including case)","Confirm the catalog configuration points at the correct database/warehouse","If a prior rename partially succeeded, use the new name instead of retrying the old one"],"exampleFix":"// before\ncatalog.renameTable(TableIdentifier.of(\"db\",\"events\"), TableIdentifier.of(\"db\",\"events_v2\"));\n// after\nTableIdentifier from = TableIdentifier.of(\"db\", \"events\");\nif (catalog.tableExists(from)) {\n  catalog.renameTable(from, TableIdentifier.of(\"db\", \"events_v2\"));\n}","handlingStrategy":"try-catch","validationCode":"TableIdentifier from = TableIdentifier.of(\"db\", \"events\");\nif (!catalog.tableExists(from)) {\n  throw new IllegalStateException(\"source table missing: \" + from);\n}","typeGuard":"boolean canRename(Catalog c, TableIdentifier from, TableIdentifier to) {\n  return c.tableExists(from) && c.namespaceExists(to.namespace()) && !c.tableExists(to);\n}","tryCatchPattern":"try {\n  catalog.renameTable(from, to);\n} catch (NoSuchTableException e) {\n  LOG.warn(\"rename skipped, source gone: {}\", from);\n}","preventionTips":["Check tableExists(from) before every rename","Make rename operations idempotent (retry-safe) in job code","Use consistent table identifiers from a shared constants/source of truth","Watch for concurrent drops/renames from other jobs"],"tags":["jdbc","table","not-found","rename"],"backgroundTag":"entity-not-found","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}