apache/seatunnel · error · TableNotExistException

Table ${tableName} does not exist in catalog ${catalogName}

Error message

Table ${tableName} does not exist in catalog ${catalogName}

What it means

Thrown by PaimonCatalog.alterTable when Paimon reports Catalog.TableNotExistException: the table identified by (databaseName, tableName) does not exist and ignoreIfNotExists=false. SeaTunnel rethrows its own TableNotExistException with the catalog name and the TablePath built from the identifier.

Source

Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java:363

                            "PluginName: %s, PluginType: %s, Message: %s",
                            PaimonSink.PLUGIN_NAME,
                            PluginType.SINK,
                            "Cannot find paimon catalog factory"));
        }
        return (PaimonCatalog)
                catalogFactory.createCatalog(catalogFactory.factoryIdentifier(), readonlyConfig);
    }

    // --------------------------------------------------------------------------------------------
    // alterTable
    // --------------------------------------------------------------------------------------------

    public void alterTable(
            Identifier identifier, SchemaChange schemaChange, boolean ignoreIfNotExists) {
        try {
            catalog.alterTable(identifier, schemaChange, ignoreIfNotExists);
        } catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {
            throw new TableNotExistException(
                    this.catalogName,
                    TablePath.of(identifier.getDatabaseName(), identifier.getTableName()),
                    e);
        } catch (org.apache.paimon.catalog.Catalog.ColumnAlreadyExistException e) {
            throw new CatalogException("ColumnAlreadyExistException: {}", e);
        } catch (org.apache.paimon.catalog.Catalog.ColumnNotExistException e) {
            throw new CatalogException("ColumnNotExistException: {}", e);
        }
    }

    public void alterTable(
            Identifier identifier, List<SchemaChange> schemaChanges, boolean ignoreIfNotExists) {
        try {
            catalog.alterTable(identifier, schemaChanges, ignoreIfNotExists);
        } catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {
            throw new TableNotExistException(
                    this.catalogName,
                    TablePath.of(identifier.getDatabaseName(), identifier.getTableName()),

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check catalog.tableExists(TablePath.of(database, table)) before altering, or pass ignoreIfNotExists=true
  2. Fix the identifier database/table names and case
  3. Confirm the warehouse/metastore config targets the environment where the table exists
  4. Recreate the table if it was dropped unintentionally before re-running the alter

Example fix

// before
catalog.alterTable(identifier, schemaChange, false);
// after
if (catalog.tableExists(TablePath.of(identifier.getDatabaseName(), identifier.getTableName()))) {
    catalog.alterTable(identifier, schemaChange, false);
}
Defensive patterns

Strategy: validation

Validate before calling

TablePath tp = TablePath.of(identifier.getDatabaseName(), identifier.getTableName());
if (!catalog.tableExists(tp)) {
    LOG.warn("skip alter, table missing: {}", tp);
    return;
}
catalog.alterTable(identifier, schemaChange, false);

Try / catch

try {
    catalog.alterTable(identifier, schemaChange, false);
} catch (TableNotExistException e) {
    LOG.error("alter failed, table {} missing in {}", e.getTablePath(), e.getCatalogName());
}

Prevention

When it happens

Trigger: Calling alterTable(identifier, schemaChange, false) on a missing table; identifier's database/table name wrong or wrong case; concurrent drop between existence check and alter.

Common situations: Schema-evolution jobs running against a table that was renamed/dropped; multi-environment setups (dev vs prod warehouse) with the table present in only one; case-sensitivity mistakes in identifiers.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/4676e7065a7c1968. Report an issue: GitHub.