alibaba/DataX · error · RuntimeException
Failed to create row serializer, unsupported `format` from s
Error message
Failed to create row serializer, unsupported `format` from stream load properties.
What it means
DorisCodecFactory.createCodec throws this when the stream load format derived from loadProps.format is neither csv nor json (Keys.StreamLoadFormat has exactly those two members). The factory builds a DorisCsvCodec or DorisJsonCodec and has no default branch, so any other format string fails immediately with this RuntimeException.
Source
Thrown at doriswriter/src/main/java/com/alibaba/datax/plugin/writer/doriswriter/DorisCodecFactory.java:17
package com.alibaba.datax.plugin.writer.doriswriter;
import java.util.Map;
public class DorisCodecFactory {
public DorisCodecFactory (){
}
public static DorisCodec createCodec( Keys writerOptions) {
if ( Keys.StreamLoadFormat.CSV.equals(writerOptions.getStreamLoadFormat())) {
Map<String, Object> props = writerOptions.getLoadProps();
return new DorisCsvCodec (null == props || !props.containsKey("column_separator") ? null : String.valueOf(props.get("column_separator")));
}
if ( Keys.StreamLoadFormat.JSON.equals(writerOptions.getStreamLoadFormat())) {
return new DorisJsonCodec (writerOptions.getColumns());
}
throw new RuntimeException("Failed to create row serializer, unsupported `format` from stream load properties.");
}
}
View on GitHub (pinned to 80ec23d5c5)
Solutions
- Set loadProps.format to exactly "csv" or "json" (lowercase) in the doriswriter job configuration.
- Remove the format key if the default CSV behavior is what you want.
- Confirm the key lives inside loadProps, not at the writer top level.
- Check your doriswriter build's Keys.StreamLoadFormat enum for the supported set before choosing a format.
Example fix
// before
"loadProps": { "format": "CSV" }
// after
"loadProps": { "format": "csv", "column_separator": "\\x01" } Defensive patterns
Strategy: validation
Validate before calling
String fmt = (String) loadProps.getOrDefault("format", "csv");
if (!"csv".equals(fmt) && !"json".equals(fmt)) throw new IllegalArgumentException("loadProps.format must be 'csv' or 'json' (lowercase), got: " + fmt); Type guard
boolean isSupportedFormat(String f) { return "csv".equals(f) || "json".equals(f); } Prevention
- Schema-validate the doriswriter job JSON (allowed loadProps keys and enums) in CI.
- Use lowercase enum values exactly as Keys.StreamLoadFormat defines them.
When it happens
Trigger: Setting "loadProps": { "format": "CSV_WITH_HEADER" }, "format": "parquet" (unsupported in this build), or any casing variant like "Csv" — the enum comparison is exact, so case mismatches also miss both branches and fall to the throw. Omitting format entirely is safe only if the default resolves to csv.
Common situations: Copying stream load documentation from newer Doris/Flink connectors that support more formats, casing drift after editing the job JSON, or setting format under the wrong key so it is read as an unexpected value.
Related errors
- load_url cannot be empty, or the host cannot connect.Please
- Failed to parse delimiter: `Hex str is empty`
- Failed to parse delimiter: `Hex str length error`
- Failed to parse delimiter: `Hex str format error`
- Unable to flush data to Doris: unknown result status.
AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14).
Data as JSON: /api/errors/7a7379865748d16c.
Report an issue: GitHub.