apache/flink · error · java.lang.RuntimeException

Could not serialize row '%s'.

Error message

Could not serialize row '%s'.

What it means

Error "Could not serialize row '%s'." thrown in apache/flink.

Source

Thrown at flink-formats/flink-json/src/main/java/org/apache/flink/formats/json/JsonRowDataSerializationSchema.java:119

                JacksonMapperFactory.createObjectMapper()
                        .configure(
                                JsonGenerator.Feature.WRITE_BIGDECIMAL_AS_PLAIN,
                                encodeDecimalAsPlainNumber)
                        .configure(DeserializationFeature.USE_BIG_DECIMAL_FOR_FLOATS, true)
                        .configure(JsonNodeFeature.STRIP_TRAILING_BIGDECIMAL_ZEROES, false);
    }

    @Override
    public byte[] serialize(RowData row) {
        if (node == null || ignoreNullFields) {
            node = mapper.createObjectNode();
        }

        try {
            runtimeConverter.convert(mapper, node, row);
            return mapper.writeValueAsBytes(node);
        } catch (Throwable t) {
            throw new RuntimeException(String.format("Could not serialize row '%s'.", row), t);
        }
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        JsonRowDataSerializationSchema that = (JsonRowDataSerializationSchema) o;
        return rowType.equals(that.rowType)
                && timestampFormat.equals(that.timestampFormat)
                && mapNullKeyMode.equals(that.mapNullKeyMode)
                && mapNullKeyLiteral.equals(that.mapNullKeyLiteral)
                && encodeDecimalAsPlainNumber == that.encodeDecimalAsPlainNumber
                && ignoreNullFields == that.ignoreNullFields;

View on GitHub (pinned to 2f3c205e92)

Solutions

  1. Address the cause reported by the error message: Could not serialize row 'the reported value'.
  2. Verify the inputs, configuration values, and classpath/dependency setup related to this operation, then retry.

Example fix

Correct the condition described ("Could not serialize row 'the reported value'.") and rerun the job or command.

When it happens

Trigger: Triggered at runtime when the operation fails because: Could not serialize row 'the reported value'.

Common situations: Commonly caused by misconfiguration, missing dependencies or files, unsupported types or operations, or invalid user input leading to: Could not serialize row 'the reported value'.


AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14). Data as JSON: /api/errors/6eea8946953bbc0d. Report an issue: GitHub.