apache/seatunnel · error · CatalogException
Failed getting table %s
Error message
Failed getting table %s
What it means
IrisCatalog.getTable wraps any exception raised while reading table metadata (after the existence check) into CatalogException("Failed getting table %s"). Includes SQL errors from the metadata query, connection problems, or errors building the CatalogTable/connector options.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/catalog/iris/IrisCatalog.java:219
Optional<PrimaryKey> primaryKey = getPrimaryKey(metaData, tablePath);
List<ConstraintKey> constraintKeys = getConstraintKeys(metaData, tablePath);
TableSchema.Builder builder = TableSchema.builder();
buildColumnsWithErrorCheck(tablePath, resultSet, builder);
// add primary key
primaryKey.ifPresent(builder::primaryKey);
// add constraint key
constraintKeys.forEach(builder::constraintKey);
TableIdentifier tableIdentifier = getTableIdentifier(tablePath);
return CatalogTable.of(
tableIdentifier,
builder.build(),
buildConnectorOptions(tablePath),
Collections.emptyList(),
"",
catalogName);
}
} catch (Exception e) {
throw new CatalogException(
String.format("Failed getting table %s", tablePath.getFullName()), e);
}
}
@Override
public void createDatabase(TablePath tablePath, boolean ignoreIfExists)
throws DatabaseAlreadyExistException, CatalogException {
checkNotNull(tablePath.getDatabaseName(), "Database name cannot be null");
createDatabaseInternal(tablePath.getDatabaseName());
}
@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 =View on GitHub (pinned to cf67b549a7)
Solutions
- Inspect the chained cause for the concrete exception (SQL error vs. type-mapping error)
- Re-run the metadata SQL manually in IRIS to see which column/datatype fails
- Confirm the catalog user can read the table's column metadata (INFORMATION_SCHEMA/system views)
- Retry on transient connection failures; verify URL and credentials from getUrlFromDatabaseName
- If a datatype is unmappable, extend the IRIS type converter or cast the column in IRIS
Example fix
// before
CatalogTable t = catalog.getTable(tablePath); // CatalogException
// after
try {
CatalogTable t = catalog.getTable(tablePath);
} catch (CatalogException e) {
LOG.error("getTable {} failed: {}", tablePath.getFullName(), e.getCause());
throw e;
} Defensive patterns
Strategy: try-catch
Validate before calling
if (!catalog.tableExists(tablePath)) {
throw new IllegalStateException("Table missing before getTable: " + tablePath.getFullName());
} Try / catch
try {
CatalogTable t = catalog.getTable(tablePath);
} catch (CatalogException e) {
LOG.error("getTable {} failed: {}", tablePath.getFullName(), e.getCause(), e);
throw e;
} Prevention
- Read getCause() to distinguish SQL vs type-mapping failures
- Verify the catalog user can read column metadata
- Avoid concurrent ALTERs while reading metadata
- Extend the IRIS type converter for unmappable datatypes
When it happens
Trigger: Calling getTable(TablePath) when the metadata SELECT fails (SQLException), the connection URL from getUrlFromDatabaseName is bad, or catalog/connector option building throws for the discovered schema.
Common situations: IRIS datatype returned by the metadata query is unmappable to SeaTunnel types; transient connection drops; privileges to read column metadata missing; table altered concurrently so metadata query breaks.
Understand the failure class
Background: Database query failed: Internal Server Error 500s wrapping SQL, Prisma, and connection failures — what to check first — this error's family across 16 libraries.
Related errors
- Failed getting table {tablePath.getFullName()}
- Failed listing database in catalog {this.catalogName}
- Not supported for list databases for iris
- Failed to querySQLResult
- Failed listing database in catalog %s
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/a7d6d61dec79e5c5.
Report an issue: GitHub.