apache/seatunnel · error · CassandraConnectorException
ILLEGAL_ARGUMENT
ILLEGAL_ARGUMENT
Error message
Duplicate table found in tables_configs: " + tableId
What it means
CassandraSource.buildTableConfigs iterates tables_configs and detects when two entries resolve to the same tableId; a duplicate would create two parallel readers for one table. It throws ILLEGAL_ARGUMENT naming the duplicated tableId to make the config error explicit.
Source
Thrown at seatunnel-connectors-v2/connector-cassandra/src/main/java/org/apache/seatunnel/connectors/seatunnel/cassandra/source/CassandraSource.java:90
if (config.getOptional(ConnectorCommonOptions.TABLE_CONFIGS).isPresent()) {
List<Map<String, Object>> tableConfigMaps =
config.get(ConnectorCommonOptions.TABLE_CONFIGS);
List<CassandraTableConfig> configs = new ArrayList<>();
for (Map<String, Object> tableConfigMap : tableConfigMaps) {
ReadonlyConfig tableConfig = ReadonlyConfig.fromMap(tableConfigMap);
String cql = tableConfig.get(CassandraSourceOptions.CQL);
CassandraTableConfig built =
buildTableConfig(
cql,
session,
params.getKeyspace(),
params.getConsistencyLevel());
String tableId = built.getTableId();
boolean duplicate =
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",View on GitHub (pinned to cf67b549a7)
Solutions
- Remove the duplicate entry from tables_configs so each keyspace.table appears exactly once.
- If you intended multiple reads of one table, merge them into a single entry with one CQL query instead.
- Check for identical table entries differing only by whitespace/case in keyspace or table names.
- Review generated config (templating/merging tools may have duplicated the block).
Example fix
// before
tables_configs = [
{table = "ks.orders", ...},
{table = "ks.orders", ...}
]
// after
tables_configs = [
{table = "ks.orders", ...},
{table = "ks.customers", ...}
] Defensive patterns
Strategy: validation
Validate before calling
// dedupe check before submit
ids = tables_configs.map(c -> c.keyspace + '.' + c.table)
if (new Set(ids).size !== ids.length) throw new Error('duplicate table in tables_configs') Prevention
- Keep tables_configs in one canonical file to avoid merge duplication.
- Diff resolved tableIds in CI before deploying config changes.
- One entry per keyspace.table, even for multiple aliases.
When it happens
Trigger: buildTableConfigs, called from the CassandraSource constructor, finds anyMatch(c -> c.getTableId().equals(tableId)) true — two tables_configs entries specify the same keyspace.table (or aliases/configs that resolve to it).
Common situations: Copy-pasted table entry in tables_configs with only cosmetic differences (different alias but same table); accidentally listing the same table twice when splitting config across files; intended different tables but same keyspace.table typed twice.
Related errors
- FIELD_NOT_IN_TABLE
- CONFIG_VALIDATION_FAILED
- TABLE_SCHEMA_GET_FAILED
- ILLEGAL_ARGUMENT
- prepare method is not supported
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/2725889090e3e2c9.
Report an issue: GitHub.