apache/seatunnel · error · TableNotExistException

Table ${tablePath} does not exist in catalog hive

Error message

Table ${tablePath} does not exist in catalog hive

What it means

This error is raised by HiveMetaStoreCatalog.getTable when the Hive Metastore reports that the requested table does not exist in the given database. It fires when a caller (e.g. a source/sink or catalog operation) looks up a table whose tableName is absent from the Metastore, typically because the table name is misspelled, the wrong database was passed, or the table was dropped before the job ran.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveMetaStoreCatalog.java:613

                throw new DatabaseNotExistException("hive", databaseName);
            }
            return getClient().getAllTables(databaseName);
        } catch (TException e) {
            throw new CatalogException("Failed to list tables in database: " + databaseName, e);
        }
    }

    @Override
    public boolean tableExists(TablePath tablePath) throws CatalogException {
        return tableExists(tablePath.getDatabaseName(), tablePath.getTableName());
    }

    @Override
    public CatalogTable getTable(TablePath tablePath)
            throws CatalogException, TableNotExistException {
        try {
            if (!tableExists(tablePath.getDatabaseName(), tablePath.getTableName())) {
                throw new TableNotExistException("hive", tablePath);
            }
            Table hiveTable = getTable(tablePath.getDatabaseName(), tablePath.getTableName());
            return convertHiveTableToCatalogTable(hiveTable);
        } catch (TableNotExistException e) {
            throw e;
        } catch (HiveConnectorException e) {
            throw new CatalogException("Failed to get table: " + tablePath, e);
        }
    }

    @Override
    public void createTable(TablePath tablePath, CatalogTable table, boolean ignoreIfExists)
            throws TableAlreadyExistException, DatabaseNotExistException, CatalogException {
        try {
            if (!databaseExists(tablePath.getDatabaseName())) {
                throw new DatabaseNotExistException("hive", tablePath.getDatabaseName());
            }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the table exists with `SHOW TABLES IN <db>` in Hive or catalog.tableExists(tablePath).
  2. Check the table_path/database/table config values for typos and correct case.
  3. Confirm the catalog's hive-conf-dir points to the cluster hosting the table.
  4. Create the table first if the job expects it to pre-exist.

Example fix

// before
CatalogTable t = catalog.getTable(TablePath.of("sales", "orders"));
// after
if (catalog.tableExists(TablePath.of("sales", "orders"))) {
    CatalogTable t = catalog.getTable(TablePath.of("sales", "orders"));
}
Defensive patterns

Strategy: validation

Validate before calling

TablePath path = TablePath.of(db, tbl);
if (!catalog.tableExists(path)) {
    throw new IllegalArgumentException("Table not found: " + path);
}
CatalogTable table = catalog.getTable(path);

Try / catch

try {
    return catalog.getTable(tablePath);
} catch (TableNotExistException e) {
    // handle missing table: create it, skip, or user-facing error
}

Prevention

When it happens

Trigger: Calling getTable(tablePath) (or jobs resolving the source/sink table) for a table that does not exist — wrong database/table name, table not yet created, or querying the wrong metastore.

Common situations: Typos in table_path config; table created in a different namespace; schema was dropped between job submission and run; typo in case-sensitive name.

Understand the failure class

Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.

Related errors


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