apache/seatunnel · error · java.lang.UnsupportedOperationException

Unsupported BYTES value type:

Error message

Unsupported BYTES value type: 

What it means

The BYTES converter accepts byte[], and java.nio.ByteBuffer (draining into byte[]). Any other object type throws UnsupportedOperationException 'Unsupported BYTES value type' with the simple class name. This protects binary column deserialization from silently misinterpreting values.

Source

Thrown at seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/row/SeaTunnelRowDebeziumDeserializationConverters.java:636

        }
        return sb.toString();
    }

    private static DebeziumDeserializationConverter convertToBinary() {
        return new DebeziumDeserializationConverter() {
            private static final long serialVersionUID = 1L;

            @Override
            public Object convert(Object dbzObj, Schema schema) throws Exception {
                if (dbzObj instanceof byte[]) {
                    return dbzObj;
                } else if (dbzObj instanceof ByteBuffer) {
                    ByteBuffer byteBuffer = (ByteBuffer) dbzObj;
                    byte[] bytes = new byte[byteBuffer.remaining()];
                    byteBuffer.get(bytes);
                    return bytes;
                } else {
                    throw new UnsupportedOperationException(
                            "Unsupported BYTES value type: " + dbzObj.getClass().getSimpleName());
                }
            }
        };
    }

    private static DebeziumDeserializationConverter createDecimalConverter() {
        return new DebeziumDeserializationConverter() {
            private static final long serialVersionUID = 1L;

            @Override
            public Object convert(Object dbzObj, Schema schema) throws Exception {
                BigDecimal bigDecimal;
                if (dbzObj instanceof byte[]) {
                    // decimal.handling.mode=precise
                    bigDecimal = Decimal.toLogical(schema, (byte[]) dbzObj);
                } else if (dbzObj instanceof String) {
                    // decimal.handling.mode=string

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Identify the actual type from the message and cast the column to a matching SeaTunnel type (e.g. map hex-String BYTES to STRING and decode).
  2. Enable/verify the appropriate Debezium binary.handling.mode so values arrive as byte[]/ByteBuffer.
  3. Add a converter branch for the reported type (e.g. BigInteger for BIT columns, UUID) if extending the connector.

Example fix

// before
// BIT column -> BigInteger reaches BYTES converter -> throws
// after
// configure decimal.handling.mode / map column to BIGINT, or convert BigInteger -> byte[] in a custom converter
Defensive patterns

Strategy: type-guard

Validate before calling

// Java
static boolean isSupportedBytesValue(Object v) {
    return v instanceof byte[] || v instanceof java.nio.ByteBuffer;
}

Type guard

if (!(dbzObj instanceof byte[]) && !(dbzObj instanceof ByteBuffer)) {
    log.warn("BYTES column value is {} — normalize it (byte[]/ByteBuffer) or change the column type", dbzObj.getClass());
}

Try / catch

try {
    bytes = bytesConverter.convert(dbzObj);
} catch (UnsupportedOperationException e) {
    log.warn("BYTES value of unexpected type, mapping to null: {}", e.getMessage());
    bytes = null;
}

Prevention

When it happens

Trigger: convert() for BYTES receives an object that is neither byte[] nor ByteBuffer, e.g. a String, BigInteger (Debezium numeric-to-binary encodings), or BitArray from some CDC payloads.

Common situations: BIT/UUID/geometry or custom binary columns whose Debezium representation (String hex, BigInteger bitmask) is not handled by the generic BYTES converter.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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