{"record":{"id":"23af152d828f23c5","repo":"apache/seatunnel","slug":"table-schema-get-failed","errorCode":"TABLE_SCHEMA_GET_FAILED","errorMessage":"Get table schema from Cassandra source failed","messagePattern":"Get table schema from Cassandra source failed","errorType":"error_code","errorClass":"CassandraConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/source/CassandraSource.java","lineNumber":106,"sourceCode":"                            configs.stream().anyMatch(c -> c.getTableId().equals(tableId));\n                    if (duplicate) {\n                        throw new CassandraConnectorException(\n                                CommonErrorCodeDeprecated.ILLEGAL_ARGUMENT,\n                                \"Duplicate table found in tables_configs: \" + tableId);\n                    }\n                    configs.add(built);\n                }\n                return configs;\n            } else {\n                String cql = config.get(CassandraSourceOptions.CQL);\n                return Collections.singletonList(\n                        buildTableConfig(\n                                cql, session, params.getKeyspace(), params.getConsistencyLevel()));\n            }\n        } catch (CassandraConnectorException e) {\n            throw e;\n        } catch (Exception e) {\n            throw new CassandraConnectorException(\n                    CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,\n                    \"Get table schema from Cassandra source failed\",\n                    e);\n        }\n    }\n\n    private CassandraTableConfig buildTableConfig(\n            String cql,\n            CqlSession session,\n            String keyspace,\n            com.datastax.oss.driver.api.core.ConsistencyLevel consistencyLevel) {\n        ColumnDefinitions columnDefs =\n                session.execute(CassandraClient.createSimpleStatement(cql, consistencyLevel))\n                        .getColumnDefinitions();\n\n        if (columnDefs.size() == 0) {\n            throw new CassandraConnectorException(\n                    CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED,","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/source/CassandraSource.java#L88-L124","documentation":"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.","triggerScenarios":"Exception from buildTableConfig path — e.g. CassandraClient.getTableSchema failing, session/cluster connection errors, or CQL execution errors — that isn't already a CassandraConnectorException.","commonSituations":"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.","solutions":["Inspect the cause chain (this exception wraps the driver error) and fix the root issue — usually connectivity or auth.","Verify keyspace and table names in tables_configs exist via cqlsh `DESCRIBE KEYSPACES` / `DESCRIBE TABLES`.","Test basic CQL connectivity with cqlsh using the exact contact points/credentials from the config.","Check driver compatibility (datastax java-driver 4.x) with your Cassandra/DSE server version."],"exampleFix":"// before: unreachable contact point\nhost = \"10.0.0.5\"\n// after: reachable node\nhost = \"10.0.0.10\"","handlingStrategy":"retry","validationCode":"cqlsh ${HOST} -e \"select * from ${KEYSPACE}.${TABLE} limit 1;\"","typeGuard":null,"tryCatchPattern":"// retry transient connection failures on startup\ntry {\n    source.open(cfg);\n} catch (CassandraConnectorException e) {\n    if (CommonErrorCodeDeprecated.TABLE_SCHEMA_GET_FAILED.equals(e.getErrorCode())) {\n        retryWithBackoff(() -> source.open(cfg));\n    } throw e;\n}","preventionTips":["Verify cluster reachability and credentials before job submission.","Ensure keyspace/table exist in the target environment (staging vs prod).","Use driver and server versions that are mutually compatible."],"tags":["cassandra","schema","source","connection"],"backgroundTag":"database-query-failed","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}