apache/seatunnel · error · CassandraConnectorException

TABLE_SCHEMA_GET_FAILED

TABLE_SCHEMA_GET_FAILED

Error message

Get table schema from Cassandra source failed

What it means

buildTableConfigs catches any non-CassandraConnectorException during per-table setup (session creation, schema discovery via buildTableConfig) and rethrows it as TABLE_SCHEMA_GET_FAILED with the message 'Get table schema from Cassandra source failed'. Existing CassandraConnectorExceptions are rethrown unchanged, so this wraps unexpected infrastructure/ driver errors.

Source

Thrown at seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/source/CassandraSource.java:106

                            configs.stream().anyMatch(c -> c.getTableId().equals(tableId));
                    if (duplicate) {
                        throw new CassandraConnectorException(
                                CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,
                                "Duplicate table found in tables_configs: " + tableId);
                    }
                    configs.add(built);
                }
                return configs;
            } else {
                String cql = config.get(CassandraSourceOptions.CQL);
                return Collections.singletonList(
                        buildTableConfig(
                                cql, session, params.getKeyspace(), params.getConsistencyLevel()));
            }
        } catch (CassandraConnectorException e) {
            throw e;
        } catch (Exception e) {
            throw new CassandraConnectorException(
                    CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,
                    "Get table schema from Cassandra source failed",
                    e);
        }
    }

    private CassandraTableConfig buildTableConfig(
            String cql,
            CqlSession session,
            String keyspace,
            com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) {
        ColumnDefinitions columnDefs =
                session.execute(CassandraClient.createSimpleStatement(cql, consistencyLevel))
                        .getColumnDefinitions();

        if (columnDefs.size() == 0) {
            throw new CassandraConnectorException(
                    CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the cause chain (this exception wraps the driver error) and fix the root issue — usually connectivity or auth.
  2. Verify keyspace and table names in tables_configs exist via cqlsh `DESCRIBE KEYSPACES` / `DESCRIBE TABLES`.
  3. Test basic CQL connectivity with cqlsh using the exact contact points/credentials from the config.
  4. Check driver compatibility (datastax java-driver 4.x) with your Cassandra/DSE server version.

Example fix

// before: unreachable contact point
host = "10.0.0.5"
// after: reachable node
host = "10.0.0.10"
Defensive patterns

Strategy: retry

Validate before calling

cqlsh ${HOST} -e "select * from ${KEYSPACE}.${TABLE} limit 1;"

Try / catch

// retry transient connection failures on startup
try {
    source.open(cfg);
} catch (CassandraConnectorException e) {
    if (CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED.equals(e.getErrorCode())) {
        retryWithBackoff(() -> source.open(cfg));
    } throw e;
}

Prevention

When it happens

Trigger: Exception from buildTableConfig path — e.g. CassandraClient.getTableSchema failing, session/cluster connection errors, or CQL execution errors — that isn't already a CassandraConnectorException.

Common situations: Cluster unreachable or authentication failing when the source initializes; keyspace/table missing so `select * limit 1` fails; driver version mismatch with server; timeout under load.

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


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