apache/seatunnel · error · TableAlreadyExistException

TABLE_ALREADY_EXISTED

TABLE_ALREADY_EXISTED

Error message

Table %s already exist in Catalog %s.

What it means

createTable on OceanBaseOracleCatalog raises TableAlreadyExistException (TABLE_ALREADY_EXISTED) when tableExists(tablePath) reports the target table already present and ignoreIfExists is false. This is a normal, intentional pre-check failure, not a crash.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/oceanbase/OceanBaseOracleCatalog.java:97

    @Override
    public void createTable(
            TablePath tablePath, CatalogTable table, boolean ignoreIfExists, boolean createIndex)
            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {
        checkNotNull(tablePath, "Table path cannot be null");

        if (defaultSchema.isPresent()) {
            tablePath =
                    new TablePath(
                            tablePath.getDatabaseName(),
                            defaultSchema.get(),
                            tablePath.getTableName());
        }

        if (tableExists(tablePath)) {
            if (ignoreIfExists) {
                return;
            }
            throw new TableAlreadyExistException(catalogName, tablePath);
        }

        createTableInternal(tablePath, table, createIndex);
    }

    @Override
    protected List<String> getCreateTableSqls(
            TablePath tablePath, CatalogTable table, boolean createIndex) {
        return new OceanBaseOracleCreateTableSqlBuilder(table, createIndex).build(tablePath);
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set ignoreIfExists=true to skip creation when the table exists
  2. Drop the existing table first (catalog.dropTable(tablePath)) before createTable
  3. Use a unique table name/database for each run
  4. Wrap the call and catch TableAlreadyExistException when idempotent behavior is desired

Example fix

// before
catalog.createTable(path, table, false); // throws if exists
// after
try {
    catalog.createTable(path, table, false);
} catch (TableAlreadyExistException e) {
    // table already present — treat as success
}
Defensive patterns

Strategy: try-catch

Validate before calling

// pre-check before create
boolean exists = catalog.tableExists(tablePath);
if (exists && !ignoreIfExists) { /* drop or skip before calling createTable */ }

Try / catch

try { catalog.createTable(path, table, ignoreIfExists); } catch (TableAlreadyExistException e) { /* treat as success or drop+recreate */ }

Prevention

When it happens

Trigger: Calling catalog.createTable for a TablePath whose table already exists in the OceanBase Oracle tenant with ignoreIfExists=false (default).

Common situations: Re-running a job or schema-sync without dropTableFirst/ignoreIfExists enabled; concurrent jobs creating the same table; leftover tables from a previous failed run.

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


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