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

  1. Set loadProps.format to exactly "csv" or "json" (lowercase) in the doriswriter job configuration.
  2. Remove the format key if the default CSV behavior is what you want.
  3. Confirm the key lives inside loadProps, not at the writer top level.
  4. 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

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


AI-assisted analysis of alibaba/DataX@80ec23d5c5 (2026-08-14). Data as JSON: /api/errors/7a7379865748d16c. Report an issue: GitHub.