apache/seatunnel · error · SeaTunnelJsonFormatException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Unknown "type" value "%s". The MaxWell JSON message is '%s'

What it means

MaxWellJsonDeserializationSchema dispatches on the 'type' field of a Maxwell CDC JSON message (insert/update/delete are recognized). Any other value — with ignoreParseErrors=false — raises SeaTunnelJsonFormatException(UNSUPPORTED_DATA_TYPE) embedding both the unknown type and the full raw message, because SeaTunnel cannot map such events to a RowKind.

Source

Thrown at seatunnel-formats/seatunnel-format-json/src/main/java/org/apache/seatunnel/format/json/maxwell/MaxWellJsonDeserializationSchema.java:182

            if (tsNode != null) {
                MetadataUtil.setEventTime(rowBefore, tsNode.asLong() * 1000);
                MetadataUtil.setEventTime(rowAfter, tsNode.asLong() * 1000);
            }
            out.collect(rowBefore);
            out.collect(rowAfter);
        } else if (OP_DELETE.equals(type)) {
            SeaTunnelRow rowDelete = convertJsonNode(dataNode);
            rowDelete.setRowKind(RowKind.DELETE);
            if (tablePath != null && !tablePath.toString().isEmpty()) {
                rowDelete.setTableId(tablePath.toString());
            }
            if (tsNode != null) {
                MetadataUtil.setEventTime(rowDelete, tsNode.asLong() * 1000);
            }
            out.collect(rowDelete);
        } else {
            if (!ignoreParseErrors) {
                throw new SeaTunnelJsonFormatException(
                        CommonErrorCode.UNSUPPORTED_DATA_TYPE,
                        format(
                                "Unknown \"type\" value \"%s\". The MaxWell JSON message is '%s'",
                                type, new String(message)));
            }
        }
    }

    private JsonNode convertBytes(byte[] message) {
        try {
            return jsonDeserializer.deserializeToJsonNode(message);
        } catch (Exception t) {
            if (ignoreParseErrors) {
                return null;
            }
            throw new SeaTunnelJsonFormatException(
                    CommonErrorCode.CONVERT_TO_CONNECTOR_TYPE_ERROR_SIMPLE,
                    String.format("Failed to deserialize JSON '%s'.", new String(message)),

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Set ignore_parse_errors=true (format config option) to skip unsupported messages instead of failing the job
  2. Filter the Kafka topic before SeaTunnel (or use topic routing) to drop bootstrap/ddl events
  3. Configure Maxwell to only output row events (bootstrap off, output_ddl=false)
  4. Check the actual message content in the error text to identify and handle the new type explicitly

Example fix

// before
format = json
// after: skip unparseable/unexpected maxwell messages
format = json
format.ignore-parse-errors = true
Defensive patterns

Strategy: validation

Validate before calling

JsonNode typeNode = root.get("type");
String type = typeNode != null ? typeNode.asText() : null;
if (!"insert".equals(type) && !"update".equals(type) && !"delete".equals(type)) {
    // skip bootstrap/ddl events before handing to the schema
    return;
}

Try / catch

try {
    schema.deserialize(message, out);
} catch (SeaTunnelJsonFormatException e) {
    log.warn("Skipping maxwell message with unknown type: {}", e.getMessage());
}

Prevention

When it happens

Trigger: deserialize() receives a Maxwell message whose "type" is not one of insert/delete (e.g. "bootstrap-insert", "sql_update", or a corrupt/empty value) and ignoreParseErrors is false; the else-branch throws.

Common situations: Maxwell bootstrapping phase emits bootstrap-insert/bootstrap-complete events; Maxwell config with output_ddl or schema-change events; garbage/corrupted messages in the Kafka topic; mixing Maxwell versions with different type vocabularies.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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