apache/seatunnel · error · SeaTunnelException

Can't obtain schema for table %s

Error message

Can't obtain schema for table %s 

What it means

Thrown by OracleSchema.readTableSchema after the schema read completes but the requested tableId is not present in the built schema map, meaning Debezium produced no TableChange for that table. This indicates the table was not captured by the schema reader at all, rather than a JDBC failure.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-oracle/src/main/java/org/apache/seatunnel/connectors/seatunnel/cdc/oracle/utils/OracleSchema.java:94

            for (TableId id : tables.tableIds()) {
                TableId tableMapId = resolveTableId(id, tableId, tableMap);
                if (tableMap.containsKey(tableMapId)) {
                    Table table =
                            CatalogTableUtils.mergeCatalogTableConfig(
                                    tables.forTable(id), tableMap.get(tableMapId));
                    TableChanges.TableChange tableChange =
                            new TableChanges.TableChange(
                                    TableChanges.TableChangeType.CREATE, table);
                    schemasByTableId.put(tableMapId, tableChange);
                }
            }
        } catch (SQLException e) {
            throw new SeaTunnelException(
                    String.format("Failed to read schema for table %s ", tableId), e);
        }

        if (!schemasByTableId.containsKey(tableId)) {
            throw new SeaTunnelException(
                    String.format("Can't obtain schema for table %s ", tableId));
        }

        return schemasByTableId.get(tableId);
    }

    static TableId resolveTableId(
            TableId readTableId, TableId requestedTableId, Map<TableId, ?> tableMap) {
        if (tableMap.containsKey(readTableId)) {
            return readTableId;
        }

        TableId readTableIdWithRequestedCatalog =
                new TableId(requestedTableId.catalog(), readTableId.schema(), readTableId.table());
        if (tableMap.containsKey(readTableIdWithRequestedCatalog)) {
            return readTableIdWithRequestedCatalog;
        }

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Check the tableList entry includes the full database.schema.table identifier and matches Oracle's actual (usually uppercase) identifiers.
  2. Query ALL_TABLES in Oracle to confirm exact owner/table_name, then fix the config.
  3. Remember unquoted Oracle identifiers are uppercase; quoted lowercase names must be given exactly.
  4. If the table was created after the job started, restart the job so the schema is re-read.
  5. Enable debug logging to inspect which tables Debezium actually captured.

Example fix

// before
tableList = ["ORCL.SCOTT.orders"] // Oracle stores it as SCOTT.ORDERS
// after
tableList = ["ORCL.SCOTT.ORDERS"]
Defensive patterns

Strategy: validation

Validate before calling

SELECT owner, table_name FROM all_tables
WHERE UPPER(owner)=UPPER('SCOTT') AND UPPER(table_name)=UPPER('ORDERS');

Try / catch

try {
    TableChange change = oracleSchema.getTableSchema(tableId);
} catch (SeaTunnelException e) {
    LOG.warn("table {} not captured by schema reader; check tableList casing/prefix", tableId);
}

Prevention

When it happens

Trigger: readTableSchema finished without error but schemasByTableId has no entry for the requested tableId — typically because the table name in the config doesn't resolve (wrong database/schema prefix, case mismatch) or the table exists but was filtered out.

Common situations: Missing or wrong 'database-name'/'schema-name' in tableList (e.g. forgetting the schema prefix); Oracle uppercase vs quoted lowercase identifiers mismatch; typo'd table name; table created after schema capture started.

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


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