{"record":{"id":"842f94da1d5244d1","repo":"apache/seatunnel","slug":"unsupported-data-type-842f94","errorCode":"UNSUPPORTED_DATA_TYPE","errorMessage":"UnSupport redisDataType,only support string,list,hash,set,zset","messagePattern":"UnSupport redisDataType,only support string,list,hash,set,zset","errorType":"error_code","errorClass":"RedisConnectorException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/sink/RedisSinkWriter.java","lineNumber":304,"sourceCode":"                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());\n            return;\n        }\n        if (RedisDataType.SET.equals(redisDataType)) {\n            redisClient.batchWriteSet(\n                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());\n            return;\n        }\n        if (RedisDataType.HASH.equals(redisDataType)) {\n            redisClient.batchWriteHash(\n                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());\n            return;\n        }\n        if (RedisDataType.ZSET.equals(redisDataType)) {\n            redisClient.batchWriteZset(\n                    rowKinds, keyBuffer, valueBuffer, redisParameters.getExpire());\n            return;\n        }\n        throw new RedisConnectorException(\n                CommonErrorCode.UNSUPPORTED_DATA_TYPE,\n                \"UnSupport redisDataType,only support string,list,hash,set,zset\");\n    }\n\n    private SerializationSchema createSerializationSchema(\n            RedisParameters redisParameters, SeaTunnelRowType rowType) {\n\n        RedisBaseOptions.Format format = redisParameters.getFormat();\n\n        switch (format) {\n            case JSON:\n                return new JsonSerializationSchema(rowType);\n            case TEXT:\n                String fieldDelimiter = redisParameters.getFieldDelimiter();\n                return TextSerializationSchema.builder()\n                        .seaTunnelRowType(rowType)\n                        .delimiter(fieldDelimiter)\n                        .build();","sourceCodeStart":286,"sourceCodeEnd":322,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-redis/src/main/java/org/apache/seatunnel/connectors/seatunnel/redis/sink/RedisSinkWriter.java#L286-L322","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Set redis_data_type to one of: string, list, hash, set, zset in the sink config","Check the exact spelling/case of the configured value against RedisDataType enum values","If data type is derived dynamically, log the resolved redisDataType before flush and fix the upstream mapping","If a legitimately needed type is missing, extend doBatchWrite with a branch and a corresponding client batch-write method"],"exampleFix":"// before\nredis_data_type = \"sorted_set\"\n// after\nredis_data_type = \"zset\"","handlingStrategy":"validation","validationCode":"Set<String> supported = Set.of(\"string\",\"list\",\"hash\",\"set\",\"zset\");\nif (!supported.contains(cfg.get(\"redis_data_type\"))) throw new IllegalArgumentException(\"Unsupported redis_data_type: \" + cfg.get(\"redis_data_type\"));","typeGuard":"boolean isSupported(RedisDataType t) { return t != null && EnumSet.of(STRING, LIST, HASH, SET, ZSET).contains(t); }","tryCatchPattern":null,"preventionTips":["Validate redis_data_type against the enum at config load time","Keep data type values lowercase and copied from docs","Add a startup smoke test that constructs the sink writer with the production config"],"tags":["redis","sink","config","data-type"],"backgroundTag":"unsupported-enum-value","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"}