apache/seatunnel · error · SeaTunnelProtobufFormatException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

SeaTunnel protobuf format is not supported for this data type [%s]

What it means

Thrown by RowToProtobufConverter.resolveObject when converting a SeaTunnelRow field value into a protobuf message field whose SeaTunnel type is not supported for the write direction. Handled cases include maps, arrays and rows; other types hit the default branch and throw SeaTunnelProtobufFormatException with UNSUPPORTED_DATA_TYPE.

Source

Thrown at seatunnel-formats/seatunnel-format-protobuf/src/main/java/org/apache/seatunnel/format/protobuf/RowToProtobufConverter.java:101

            case BOOLEAN:
            case DECIMAL:
            case DATE:
            case TIMESTAMP:
            case BYTES:
                return data;
            case TINYINT:
                if (data instanceof Byte) {
                    return Byte.toUnsignedInt((Byte) data);
                }
                return data;
            case MAP:
                return handleMapType(fieldName, data, seaTunnelDataType, builder);
            case ARRAY:
                return Arrays.asList((Object[]) data);
            case ROW:
                return handleRowType(fieldName, data, seaTunnelDataType);
            default:
                throw new SeaTunnelProtobufFormatException(
                        ProtobufFormatErrorCode.UNSUPPORTED_DATA_TYPE,
                        String.format(
                                "SeaTunnel protobuf format is not supported for this data type [%s]",
                                seaTunnelDataType.getSqlType()));
        }
    }

    private Object handleMapType(
            String fieldName,
            Object data,
            SeaTunnelDataType<?> seaTunnelDataType,
            DynamicMessage.Builder builder) {
        Descriptors.Descriptor mapEntryDescriptor =
                descriptor.findFieldByName(fieldName).getMessageType();

        if (data instanceof Map) {
            Map<?, ?> mapData = (Map<?, ?>) data;
            mapData.forEach(

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Align the sink schema so the field uses a type protobuf supports (scalar, STRING, BYTES, temporal, MAP, ARRAY, ROW)
  2. Restructure the SeaTunnelRow so unsupported types are encoded as supported ones (e.g. converted to STRING) in an upstream transform
  3. Check the SeaTunnel version for extended protobuf type support and upgrade if available

Example fix

// before
// schema column typed with unsupported type passed straight to protobuf sink

// after
// in an upstream transform:
row.setField(idx, String.valueOf(unsupportedValue)); // encode as STRING
Defensive patterns

Strategy: validation

Validate before calling

if (type.getSqlType() != SqlType.MAP && type.getSqlType() != SqlType.ARRAY
    && type.getSqlType() != SqlType.ROW && !isScalarSupported(type.getSqlType())) {
    throw new IllegalArgumentException("Unsupported row->proto type: " + type);
}

Type guard

boolean isWritableToProtobuf(SeaTunnelDataType<?> t) {
    switch (t.getSqlType()) {
        case MAP: case ARRAY: case ROW: return true;
        default: return isScalarSupported(t.getSqlType());
    }
}

Try / catch

try {
    builder = rowToProtobufConverter.resolvedValue(fieldName, data, type, builder);
} catch (SeaTunnelProtobufFormatException e) {
    log.error("Cannot encode field {} as protobuf type {}", fieldName, type, e);
    throw e;
}

Prevention

When it happens

Trigger: resolvedValue -> resolveObject receiving a field whose seaTunnelDataType is neither a protobuf-mappable primitive/string/bytes/temporal nor MAP/ARRAY/ROW (e.g. unsupported composite or null-like types) while writing rows to protobuf format.

Common situations: Sink catalog columns typed with types the protobuf writer cannot represent; mismatch between the declared schema and the actual proto descriptor; using the protobuf format for data types introduced after the converter was written.

Related errors


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