{"record":{"id":"989a10a613c419dd","repo":"apache/iceberg","slug":"tablenotexistexception","errorCode":null,"errorMessage":"TableNotExistException","messagePattern":"TableNotExistException","errorType":"exception","errorClass":"TableNotExistException","httpStatus":null,"severity":"error","filePath":"flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java","lineNumber":375,"sourceCode":"    ImmutableMap.Builder<String, String> mergedProps = ImmutableMap.builder();\n    mergedProps.put(\n        FlinkCreateTableOptions.CONNECTOR_PROPS_KEY, FlinkDynamicTableFactory.FACTORY_IDENTIFIER);\n    mergedProps.put(FlinkCreateTableOptions.SRC_CATALOG_PROPS_KEY, srcCatalogProps);\n    mergedProps.putAll(tableProps);\n\n    return toCatalogTableWithProps(table, mergedProps.build());\n  }\n\n  private Table loadIcebergTable(ObjectPath tablePath) throws TableNotExistException {\n    try {\n      Table table = icebergCatalog.loadTable(toIdentifier(tablePath));\n      if (cacheEnabled) {\n        table.refresh();\n      }\n\n      return table;\n    } catch (org.apache.iceberg.exceptions.NoSuchTableException e) {\n      throw new TableNotExistException(getName(), tablePath, e);\n    }\n  }\n\n  @Override\n  public boolean tableExists(ObjectPath tablePath) throws CatalogException {\n    return icebergCatalog.tableExists(toIdentifier(tablePath));\n  }\n\n  @Override\n  public void dropTable(ObjectPath tablePath, boolean ignoreIfNotExists)\n      throws TableNotExistException, CatalogException {\n    try {\n      icebergCatalog.dropTable(toIdentifier(tablePath));\n    } catch (org.apache.iceberg.exceptions.NoSuchTableException e) {\n      if (!ignoreIfNotExists) {\n        throw new TableNotExistException(getName(), tablePath, e);\n      }\n    }","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/FlinkCatalog.java#L357-L393","documentation":"FlinkCatalog.loadIcebergTable converts Iceberg's NoSuchTableException into Flink's TableNotExistException. It means the requested table (in its database) does not exist in the underlying Iceberg catalog when a Flink operation tries to load the Iceberg table — raised in loadIcebergTable, used by table/alterTable.","triggerScenarios":"Loading or altering a table via tableExists/listTables naming, e.g. ALTER TABLE on a non-existent table, SELECT/DROP on a table deleted externally, or baseNamespace resolution making the actual Iceberg identifier differ from the Flink ObjectPath.","commonSituations":"Table dropped by another job/session between existence check and load; typo'd table name; environment/catalog misconfiguration pointing at a different warehouse; table exists in Flink's cached metadata but was removed from the Iceberg catalog; case mismatch in table names.","solutions":["Verify existence with tableExists or SHOW TABLES before loading/altering, and use exact casing","Confirm the Flink catalog config (catalog type, warehouse, baseNamespace) points to the environment holding the table","Refresh/rebuild Flink's catalog cache so stale metadata is discarded","If the table was renamed/dropped intentionally, create it again or update the job to reference the new name"],"exampleFix":"// before\ncatalog.alterTable(tablePath, newTable, false); // TableNotExistException if missing\n// after\nif (catalog.tableExists(tablePath)) {\n  catalog.alterTable(tablePath, newTable, false);\n} else {\n  catalog.createTable(tablePath, newTable);\n}","handlingStrategy":"try-catch","validationCode":"boolean exists = catalog.tableExists(tablePath);","typeGuard":null,"tryCatchPattern":"try {\n  CatalogTable table = catalog.getTable(tablePath);\n} catch (TableNotExistException e) {\n  LOG.warn(\"Table {} not found in catalog {}\", tablePath, e.getCatalogName());\n}","preventionTips":["Check tableExists before load/alter, and handle races gracefully","Use exact name casing from SHOW TABLES","Keep baseNamespace/warehouse config consistent across jobs and environments"],"tags":["flink","iceberg","catalog","table-not-found"],"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"}