apache/seatunnel · error · TableNotExistException
table not exist
Error message
table not exist
What it means
isExistsData checks whether an Iceberg table contains any records by reading the current snapshot's 'total-records' summary. As a precondition it requires the table to exist; if tableExists(tablePath) is false it throws TableNotExistException with message 'table not exist'.
Source
Thrown at seatunnel-connectors-v2/connector-iceberg/src/main/java/org/apache/seatunnel/connectors/seatunnel/iceberg/catalog/IcebergCatalog.java:213
log.info("Dropped table at path: {}", tablePath);
}
@Override
public void createDatabase(TablePath tablePath, boolean ignoreIfExists)
throws DatabaseAlreadyExistException, CatalogException {
// Do nothing
}
@Override
public void dropDatabase(TablePath tablePath, boolean ignoreIfNotExists)
throws DatabaseNotExistException, CatalogException {
// Do nothing
}
@Override
public boolean isExistsData(TablePath tablePath) {
if (!tableExists(tablePath)) {
throw new TableNotExistException("table not exist", tablePath);
}
TableIdentifier icebergTableIdentifier = toIcebergTableIdentifier(tablePath);
Snapshot snapshot = catalog.loadTable(icebergTableIdentifier).currentSnapshot();
if (snapshot != null) {
String total = snapshot.summary().getOrDefault("total-records", null);
return total != null && !total.equals("0");
}
return false;
}
@Override
public void executeSql(TablePath tablePath, String sql) {
Delete delete;
try {
Statement statement = CCJSqlParserUtil.parse(sql);
delete = (Delete) statement;
} catch (Throwable e) {
throw new IllegalArgumentException(View on GitHub (pinned to cf67b549a7)
Solutions
- Verify the table exists at the given tablePath in the configured catalog before calling isExistsData
- Correct the tablePath namespace/table spelling and environment (warehouse/URI) configuration
- Create the table (or skip the data-existence check) when the table is legitimately absent
Example fix
// before checking data of a not-yet-created table
if (catalog.isExistsData(TablePath.of("db", "metrics"))) { ... }
// after
if (catalog.tableExists(TablePath.of("db", "metrics")) && catalog.isExistsData(TablePath.of("db", "metrics"))) { ... } Defensive patterns
Strategy: validation
Validate before calling
if (!seaTunnelCatalog.tableExists(tablePath)) {
// skip isExistsData or create the table first
} else {
boolean hasData = seaTunnelCatalog.isExistsData(tablePath);
} Try / catch
try {
boolean hasData = seaTunnelCatalog.isExistsData(tablePath);
} catch (TableNotExistException e) {
// treat as empty/new: create table or fall back to full load
} Prevention
- Always call tableExists before isExistsData
- Handle first-run scenarios where the table is legitimately absent
- Keep catalog environment (warehouse path) consistent between jobs that write and jobs that check
When it happens
Trigger: isExistsData(tablePath) is called (e.g. by sync/consistency tooling to decide incremental vs full load) with a table path that does not exist in the configured catalog.
Common situations: Pointing the check at a table in the wrong namespace/warehouse; table dropped before the sync job runs; namespace/table name typos; catalog configured against a different environment than expected.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- Table not exist
- Can not find catalog table with factoryId [%s]
- catalog not implements SupportsNamespaces so can't check dat
- catalog not implements SupportsNamespaces so can't list data
- Only support sql: delete from ... where ..., Not support: {}
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/3577ac20cfd30582.
Report an issue: GitHub.