apache/seatunnel · error · org.apache.seatunnel.api.table.catalog.exception.CatalogException
tableExists${tablePath} error
Error message
tableExists${tablePath} error What it means
MaxComputeCatalog.tableExists wraps OdpsException from odps.tables().exists(tableName) into a CatalogException with this message. The check itself failed (SDK/network/auth error) — this does not mean the table is absent; a normal 'not exists' returns false without throwing.
Source
Thrown at seatunnel-connectors-v2/connector-maxcompute/src/main/java/org/apache/seatunnel/connectors/seatunnel/maxcompute/catalog/MaxComputeCatalog.java:137
Odps odps = getOdps(databaseName);
Tables tables = odps.tables();
List<String> tableNames = new ArrayList<>();
tables.forEach(
table -> {
tableNames.add(table.getName());
});
return tableNames;
}
@Override
public boolean tableExists(TablePath tablePath) throws CatalogException {
try {
Odps odps = getOdps(tablePath.getDatabaseName(), tablePath.getSchemaName());
com.aliyun.odps.Tables tables = odps.tables();
return tables.exists(tablePath.getTableName());
} catch (OdpsException e) {
throw new CatalogException("tableExists" + tablePath + " error", e);
}
}
@Override
public CatalogTable getTable(TablePath tablePath)
throws CatalogException, TableNotExistException {
return getTable(tablePath, new ArrayList<>());
}
@Override
public CatalogTable getTable(TablePath tablePath, List<String> fieldNames)
throws CatalogException, TableNotExistException {
if (!tableExists(tablePath)) {
throw new TableNotExistException(catalogName, tablePath);
}
Table odpsTable;
com.aliyun.odps.TableSchema odpsSchema;
try {View on GitHub (pinned to cf67b549a7)
Solutions
- Check the cause OdpsException for status code/message
- Validate the TablePath database/schema/tableName against the MaxCompute console
- Verify credentials and endpoint configuration
- Retry on transient network errors; fix permissions if 403/authorization errors
Example fix
// before
TablePath path = TablePath.of("wrong_db", "my_table");
catalog.tableExists(path); // OdpsException wrapped
// after
TablePath path = TablePath.of("my_proj", "my_table");
if (catalog.tableExists(path)) {
catalog.getTable(path);
} Defensive patterns
Strategy: try-catch
Validate before calling
// pre-check identifiers before catalog calls
if (tablePath.getDatabaseName() == null || tablePath.getTableName() == null) {
throw new IllegalArgumentException("tablePath must include database and table");
}
if (!tablePath.getDatabaseName().matches("[a-zA-Z_][a-zA-Z0-9_]*")) {
throw new IllegalArgumentException("Invalid MaxCompute project name: " + tablePath.getDatabaseName());
} Try / catch
try {
if (catalog.tableExists(tablePath)) {
return catalog.getTable(tablePath);
}
} catch (CatalogException e) {
if (e.getCause() instanceof OdpsException
&& ((OdpsException) e.getCause()).getErrorCode() != null
&& ((OdpsException) e.getCause()).getErrorCode().contains("NoSuchObject")) {
return null; // treat as absent
}
throw e;
} Prevention
- Confirm database/table names against the MaxCompute console before the job
- Use fully qualified TablePath (project.table) consistently
- Check OdpsException error codes to distinguish auth vs not-found vs network
- Add retries with backoff for transient SDK/network failures
When it happens
Trigger: getTable calls tableExists(tablePath) before fetching metadata; the SDK existence check throws OdpsException due to connectivity, auth, or invalid database/schema/project resolution.
Common situations: Database name in TablePath does not match any project; wrong endpoint; revoked read permissions on the table's project; transient network failures during job startup.
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
- Check ${databaseName} exist error
- listDatabases exist error
- create partition error
- execute sql error
- create table error
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/2b14e88c52ebfa48.
Report an issue: GitHub.