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

  1. Remove the duplicate entry from tables_configs so each keyspace.table appears exactly once.
  2. If you intended multiple reads of one table, merge them into a single entry with one CQL query instead.
  3. Check for identical table entries differing only by whitespace/case in keyspace or table names.
  4. 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

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


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