apache/seatunnel · error · TableAlreadyExistException
Table ${tablePath} already exists in catalog ${catalogName}
Error message
Table ${tablePath} already exists in catalog ${catalogName} What it means
PaimonCatalog.createTable maps Paimon's native Catalog.TableAlreadyExistException to SeaTunnel's TableAlreadyExistException when catalog.createTable finds the identifier already occupied. It signals the create request conflicts with an existing table at the same path.
Source
Thrown at seatunnel-connectors-v2/connector-paimon/src/main/java/org/apache/seatunnel/connectors/seatunnel/paimon/catalog/PaimonCatalog.java:185
try {
return catalog.getTable(toIdentifier(tablePath));
} catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {
throw new TableNotExistException(this.catalogName, tablePath);
}
}
@Override
public void createTable(TablePath tablePath, CatalogTable table, boolean ignoreIfExists)
throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {
try {
Schema paimonSchema =
SchemaUtil.toPaimonSchema(
table.getTableSchema(),
new PaimonSinkConfig(readonlyConfig),
table.getComment());
catalog.createTable(toIdentifier(tablePath), paimonSchema, ignoreIfExists);
} catch (org.apache.paimon.catalog.Catalog.TableAlreadyExistException e) {
throw new TableAlreadyExistException(this.catalogName, tablePath);
} catch (org.apache.paimon.catalog.Catalog.DatabaseNotExistException e) {
throw new DatabaseNotExistException(this.catalogName, tablePath.getDatabaseName());
} catch (Exception e) {
resolveException(e);
}
}
@Override
public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)
throws TableNotExistException, CatalogException {
try {
catalog.dropTable(toIdentifier(tablePath), ignoreIfNotExists);
} catch (org.apache.paimon.catalog.Catalog.TableNotExistException e) {
throw new TableNotExistException(this.catalogName, tablePath);
}
}
@OverrideView on GitHub (pinned to cf67b549a7)
Solutions
- Pass ignoreIfExists=true if the table may legitimately pre-exist.
- Drop the existing table (or use truncateTable) before recreating.
- Use a different table path for the new output.
- Coordinate concurrent jobs so only one creates the table, or make creation idempotent.
Example fix
// before catalog.createTable(path, table, false); // fails if table exists // after catalog.createTable(path, table, true); // idempotent create
Defensive patterns
Strategy: try-catch
Validate before calling
if (catalog.tableExists(tablePath)) {
// already there: skip, drop, or reuse
} Try / catch
try {
catalog.createTable(tablePath, table, false);
} catch (TableAlreadyExistException e) {
LOG.warn("Table {} already exists; skipping create", tablePath);
} Prevention
- Use ignoreIfExists=true for idempotent pipelines.
- Check tableExists before auto-creating tables.
- Avoid concurrent jobs creating the same table path.
When it happens
Trigger: Calling createTable(tablePath, table, ignoreIfExists) where a table already exists at the identifier and ignoreIfExists is false, causing Paimon to raise TableAlreadyExistException.
Common situations: Auto-create logic running against a table created by a previous job, concurrent jobs creating the same table, re-running a pipeline without drop/cleanup, or forgetting ignoreIfExists=true for idempotent creates.
Understand the failure class
Background: "already exists" / EEXIST / FileAlreadyExistsException: what the 'file already exists' error means and how to fix it — this error's family across 37 libraries.
Related errors
- TableAlreadyExistException: catalogName, tablePath
- Table ${tablePath} already exists in catalog hive
- Failed to create table: ${tablePath}
- Table 'TablePath{databaseName='null', schemaName='null', tab
- Failed creating table {tablePath.getFullName()}
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/f1ce775280e93f2c.
Report an issue: GitHub.