apache/seatunnel · error · RedisConnectorException

ILLEGAL_ARGUMENT

ILLEGAL_ARGUMENT

Error message

Duplicate table_path found: %s. Please ensure each table configuration has a unique table_path.

What it means

RedisSource.createSourceTablesMap builds a map from TablePath to RedisTableConfig for multi-table source configs. It throws RedisConnectorException with ILLEGAL_ARGUMENT when two table configs resolve to the same table_path, because each Redis table must map to exactly one configuration entry.

Source

Thrown at seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/source/RedisSource.java:68

        this.sourceTablesMap = createSourceTablesMap(readonlyConfig);
    }

    /**
     * Create source tables map from configuration, supporting both single and multi-table modes.
     *
     * @param readonlyConfig Configuration
     * @return Map of TablePath to RedisTableConfig
     */
    private Map<TablePath, RedisTableConfig> createSourceTablesMap(ReadonlyConfig readonlyConfig) {
        List<RedisTableConfig> tableConfigs = RedisTableConfig.of(readonlyConfig);
        Map<TablePath, RedisTableConfig> tablesMap = new LinkedHashMap<>();

        for (RedisTableConfig tableConfig : tableConfigs) {
            TablePath tablePath = tableConfig.getTablePath();

            // Check for duplicate TablePath
            if (tablesMap.containsKey(tablePath)) {
                throw new RedisConnectorException(
                        CommonErrorCode.ILLEGAL_ARGUMENT,
                        String.format(
                                "Duplicate table_path found: %s. Please ensure each table configuration has a unique table_path.",
                                tablePath));
            }

            tablesMap.put(tablePath, tableConfig);
        }

        return tablesMap;
    }

    @Override
    public Boundedness getBoundedness() {
        return Boundedness.BOUNDED;
    }

    @Override

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Make each table block's table_path unique in the source config
  2. Review the generated/templated config for duplicated table_path entries
  3. If two tables genuinely need the same path, merge their key patterns into a single table config

Example fix

// before
tables = [{table_path = "db0:key:*"}, {table_path = "db0:key:*"}]
// after
tables = [{table_path = "db0:key:*"}, {table_path = "db0:other:*"}]
Defensive patterns

Strategy: validation

Validate before calling

Set<String> seen = new HashSet<>();
for (Map<String,Object> t : tables) { if (!seen.add((String)t.get("table_path"))) throw new IllegalArgumentException("Duplicate table_path: " + t.get("table_path")); }

Prevention

When it happens

Trigger: A multi-table Redis source declares two table blocks whose key/key_pattern/database resolve to an identical TablePath; createSourceTablesMap runs at RedisSource construction time and fails the job immediately.

Common situations: Copy-pasted table blocks where table_path was not changed; generated multi-table configs where distinct key patterns collapse to the same path; template expansion producing duplicate entries.

Related errors


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