apache/seatunnel · error · RedisConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

UnSupport redisDataType,only support string,list,hash,set,zset

What it means

RedisSinkWriter.doBatchWrite dispatches batch writes by the configured redis_data_type. When the resolved RedisDataType is not one of string, list, hash, set, or zset (or is null), the writer cannot translate the row into a Redis command and throws RedisConnectorException with UNSUPPORTED_DATA_TYPE. This is a terminal configuration validation failure for the sink.

Source

Thrown at seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/sink/RedisSinkWriter.java:304

                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());
            return;
        }
        if (RedisDataType.SET.equals(redisDataType)) {
            redisClient.batchWriteSet(
                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());
            return;
        }
        if (RedisDataType.HASH.equals(redisDataType)) {
            redisClient.batchWriteHash(
                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());
            return;
        }
        if (RedisDataType.ZSET.equals(redisDataType)) {
            redisClient.batchWriteZset(
                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());
            return;
        }
        throw new RedisConnectorException(
                CommonErrorCode.UNSUPPORTED_DATA_TYPE,
                "UnSupport redisDataType,only support string,list,hash,set,zset");
    }

    private SerializationSchema createSerializationSchema(
            RedisParameters redisParameters, SeaTunnelRowType rowType) {

        RedisBaseOptions.Format format = redisParameters.getFormat();

        switch (format) {
            case JSON:
                return new JsonSerializationSchema(rowType);
            case TEXT:
                String fieldDelimiter = redisParameters.getFieldDelimiter();
                return TextSerializationSchema.builder()
                        .seaTunnelRowType(rowType)
                        .delimiter(fieldDelimiter)
                        .build();

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set redis_data_type to one of: string, list, hash, set, zset in the sink config
  2. Check the exact spelling/case of the configured value against RedisDataType enum values
  3. If data type is derived dynamically, log the resolved redisDataType before flush and fix the upstream mapping
  4. If a legitimately needed type is missing, extend doBatchWrite with a branch and a corresponding client batch-write method

Example fix

// before
redis_data_type = "sorted_set"
// after
redis_data_type = "zset"
Defensive patterns

Strategy: validation

Validate before calling

Set<String> supported = Set.of("string","list","hash","set","zset");
if (!supported.contains(cfg.get("redis_data_type"))) throw new IllegalArgumentException("Unsupported redis_data_type: " + cfg.get("redis_data_type"));

Type guard

boolean isSupported(RedisDataType t) { return t != null && EnumSet.of(STRING, LIST, HASH, SET, ZSET).contains(t); }

Prevention

When it happens

Trigger: A Redis sink job runs with a redis_data_type value that maps to a type outside the supported set (or is unset/typo'd so no branch in doBatchWrite matches); batch rows reach flush() and fail on the first write attempt.

Common situations: Typo in redis_data_type config (e.g. 'hashes', 'sorted_set'); using a data type added to the enum for source-only features; programmatic RedisParameters built with a null/default data type.

Related errors


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