apache/seatunnel · error · TableNotExistException

TABLE_NOT_EXISTED

TABLE_NOT_EXISTED

Error message

Table %s does not exist in Catalog %s.

What it means

Thrown by IrisCatalog.getTable(TablePath) when the existence pre-check tableExists returns false, via TableNotExistException(catalogName, tablePath). It means the requested table (or its database/schema path) was not found in the IRIS catalog.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/iris/IrisCatalog.java:186

        try {
            return queryString(defaultUrl, getListTableSql(schemaName), this::getTableName);
        } catch (Exception e) {
            throw new CatalogException(
                    String.format("Failed listing database in catalog %s", catalogName), e);
        }
    }

    @Override
    public CatalogTable getTable(String sqlQuery) throws SQLException {
        Connection defaultConnection = getConnection(defaultUrl);
        return CatalogUtils.getCatalogTable(defaultConnection, sqlQuery, new IrisTypeMapper());
    }

    @Override
    public CatalogTable getTable(TablePath tablePath)
            throws CatalogException, TableNotExistException {
        if (!tableExists(tablePath)) {
            throw new TableNotExistException(catalogName, tablePath);
        }

        String dbUrl;
        if (StringUtils.isNotBlank(tablePath.getDatabaseName())) {
            dbUrl = getUrlFromDatabaseName(tablePath.getDatabaseName());
        } else {
            dbUrl = getUrlFromDatabaseName(defaultDatabase);
        }
        try {
            Connection conn = getConnection(dbUrl);
            DatabaseMetaData metaData = conn.getMetaData();
            try (ResultSet resultSet =
                    metaData.getColumns(
                            null, tablePath.getSchemaName(), tablePath.getTableName(), null)) {
                Optional<PrimaryKey> primaryKey = getPrimaryKey(metaData, tablePath);
                List<ConstraintKey> constraintKeys = getConstraintKeys(metaData, tablePath);
                TableSchema.Builder builder = TableSchema.builder();
                buildColumnsWithErrorCheck(tablePath, resultSet, builder);

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Verify the table exists in the IRIS namespace with a direct SQL query (SELECT ... FROM table)
  2. Check TablePath database/schema names — ensure getUrlFromDatabaseName maps to the correct IRIS namespace URL
  3. Confirm exact name casing matches what IRIS stores
  4. If creating the table programmatically, call createTable first with ignoreIfExists=true before getTable

Example fix

// before
CatalogTable t = catalog.getTable(tablePath); // TableNotExistException
// after
if (catalog.tableExists(tablePath)) {
    CatalogTable t = catalog.getTable(tablePath);
} else {
    catalog.createTable(tablePath, schema, true);
}
Defensive patterns

Strategy: validation

Validate before calling

if (!catalog.tableExists(tablePath)) {
    catalog.createTable(tablePath, catalogTable, true); // ensure it exists
}
CatalogTable t = catalog.getTable(tablePath);

Try / catch

try {
    CatalogTable t = catalog.getTable(tablePath);
} catch (TableNotExistException e) {
    LOG.error("Table {} not found in {}; check names/casing", tablePath.getFullName(), e.getCatalogName());
    throw e;
}

Prevention

When it happens

Trigger: Calling getTable with a TablePath whose table does not exist in the mapped IRIS namespace; wrong database name in TablePath mapping to the wrong URL; case-sensitivity mismatch between the config and IRIS table names.

Common situations: Table name typo or wrong case (IRIS table names can be case-sensitive when quoted); table exists in a different namespace than the databaseName given; table was dropped/recreated between checks; SQL config referencing a table before it was created.

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