apache/seatunnel · error · CatalogException

ColumnNotExistException: {}

Error message

ColumnNotExistException: {}

What it means

PaimonCatalog catches org.apache.paimon.catalog.Catalog.ColumnNotExistException during ALTER TABLE and rethrows it as CatalogException with the literal message "ColumnNotExistException: {}". It means a schema change referenced a column (e.g. RenameColumn, DropColumn, UpdateColumnType, UpdateColumnNullability) that does not exist in the table. The {} placeholder is never interpolated; the missing column name is only in the wrapped cause.

Source

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

    }

    // --------------------------------------------------------------------------------------------
    // 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()),
                    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);
        }
    }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the column name against the current Paimon table schema and correct the spelling/case in the SchemaChange.
  2. Remove obsolete changes from the DDL list, or filter out changes whose source field no longer exists before calling alterTable.
  3. Use the alterTable overload with ignoreIfNotExists=true so non-existing column changes are skipped instead of failing.
  4. Refresh/reopen the catalog to clear stale schema metadata.

Example fix

// before
changes.add(SchemaChange.dropColumn("old_col"));
catalog.alterTable(identifier, changes);
// after
if (existingFieldNames.contains("old_col")) {
    changes.add(SchemaChange.dropColumn("old_col"));
}
catalog.alterTable(identifier, changes, true);
Defensive patterns

Strategy: validation

Validate before calling

Set<String> fields = catalog.getTable(identifier).fields().stream()
        .map(DataField::name).collect(Collectors.toSet());
changes.removeIf(c -> referencesMissingField(c, fields));

Try / catch

try {
    catalog.alterTable(identifier, changes, true);
} catch (CatalogException e) {
    if (e.getCause() instanceof org.apache.paimon.catalog.Catalog.ColumnNotExistException) {
        LOG.warn("referenced column missing, skipping change");
    } else { throw e; }
}

Prevention

When it happens

Trigger: Calling PaimonCatalog.alterTable(identifier, schemaChanges[, ignoreIfNotExists]) where the change list contains a RenameColumn/DropColumn/UpdateColumn* referring to a field absent from the target Paimon table's current schema.

Common situations: Replaying a DDL script against a table that was already modified; dropping/renaming a column that was removed by a previous job; case mismatch ("Name" vs "name") between the change and the schema; stale metadata cache after another process altered the table.

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/504ccdee253d57a7. Report an issue: GitHub.