apache/seatunnel · error · TableAlreadyExistException

TableAlreadyExistException: table '${tablePath}' already exi

Error message

TableAlreadyExistException: table '${tablePath}' already exists in catalog '${catalogName}'

What it means

Thrown by HbaseCatalog.createTable when the target HBase table already exists and ignoreIfExists is false. It is the standard catalog TableAlreadyExistException, so the message is a templated sentinel naming tablePath and catalogName.

Source

Thrown at seatunnel-connectors-v2/connector-hbase/src/main/java/org/apache/seatunnel/connectors/seatunnel/hbase/catalog/HbaseCatalog.java:128

                (databaseName == null || databaseName.isEmpty())
                        ? tableName
                        : databaseName + ":" + tableName;
        return hbaseClient.tableExists(fullTableName);
    }

    @Override
    public CatalogTable getTable(TablePath tablePath)
            throws CatalogException, TableNotExistException {
        throw new UnsupportedOperationException("Not implement");
    }

    @Override
    public void createTable(TablePath tablePath, CatalogTable table, boolean ignoreIfExists)
            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {
        checkNotNull(tablePath, "tablePath cannot be null");
        if (tableExists(tablePath)) {
            if (!ignoreIfExists) {
                throw new TableAlreadyExistException(catalogName, tablePath);
            }
            return;
        }
        hbaseClient.createTable(
                tablePath.getDatabaseName(),
                tablePath.getTableName(),
                hbaseParameters.getFamilyNames().values().stream()
                        .filter(value -> !"all_columns".equals(value))
                        .collect(Collectors.toList()),
                ignoreIfExists);
    }

    @Override
    public void dropTable(TablePath tablePath, boolean ignoreIfNotExists)
            throws TableNotExistException, CatalogException {
        checkNotNull(tablePath);
        if (!tableExists(tablePath)) {
            if (!ignoreIfNotExists) {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Pass ignoreIfExists = true to make creation idempotent.
  2. Drop the existing table first (catalog.dropTable or HBase shell disable+drop).
  3. Use a different table name/path for the new data.

Example fix

// before
catalog.createTable(path, table, false); // fails on rerun
// after
catalog.createTable(path, table, true); // skip if exists
Defensive patterns

Strategy: validation

Validate before calling

if (catalog.tableExists(tablePath) && !ignoreIfExists) {
    ignoreIfExists = true; // or drop first
}

Try / catch

try {
    catalog.createTable(tablePath, table, false);
} catch (TableAlreadyExistException e) {
    LOG.info("Table {} already exists; reusing", tablePath.getFullName());
}

Prevention

When it happens

Trigger: Calling createTable(tablePath, table, ignoreIfExists=false) for a table that already exists in HBase; auto-create logic running against a pre-existing table without ignoreIfExists=true.

Common situations: Re-running a job/pipeline that created the table earlier; concurrent jobs creating the same table; assuming HBase table names are per-namespace unique but reusing an old one.

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