{"record":{"id":"dc47ccc1edec35c9","repo":"apache/seatunnel","slug":"unsupported-bytes-value-type","errorCode":null,"errorMessage":"Unsupported BYTES value type: ","messagePattern":"Unsupported BYTES value type: ","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/row/SeaTunnelRowDebeziumDeserializationConverters.java","lineNumber":636,"sourceCode":"        }\n        return sb.toString();\n    }\n\n    private static DebeziumDeserializationConverter convertToBinary() {\n        return new DebeziumDeserializationConverter() {\n            private static final long serialVersionUID = 1L;\n\n            @Override\n            public Object convert(Object dbzObj, Schema schema) throws Exception {\n                if (dbzObj instanceof byte[]) {\n                    return dbzObj;\n                } else if (dbzObj instanceof ByteBuffer) {\n                    ByteBuffer byteBuffer = (ByteBuffer) dbzObj;\n                    byte[] bytes = new byte[byteBuffer.remaining()];\n                    byteBuffer.get(bytes);\n                    return bytes;\n                } else {\n                    throw new UnsupportedOperationException(\n                            \"Unsupported BYTES value type: \" + dbzObj.getClass().getSimpleName());\n                }\n            }\n        };\n    }\n\n    private static DebeziumDeserializationConverter createDecimalConverter() {\n        return new DebeziumDeserializationConverter() {\n            private static final long serialVersionUID = 1L;\n\n            @Override\n            public Object convert(Object dbzObj, Schema schema) throws Exception {\n                BigDecimal bigDecimal;\n                if (dbzObj instanceof byte[]) {\n                    // decimal.handling.mode=precise\n                    bigDecimal = Decimal.toLogical(schema, (byte[]) dbzObj);\n                } else if (dbzObj instanceof String) {\n                    // decimal.handling.mode=string","sourceCodeStart":618,"sourceCodeEnd":654,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-cdc/connector-cdc-base/src/main/java/org/apache/seatunnel/connectors/cdc/debezium/row/SeaTunnelRowDebeziumDeserializationConverters.java#L618-L654","documentation":"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.","triggerScenarios":"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.","commonSituations":"BIT/UUID/geometry or custom binary columns whose Debezium representation (String hex, BigInteger bitmask) is not handled by the generic BYTES converter.","solutions":["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).","Enable/verify the appropriate Debezium binary.handling.mode so values arrive as byte[]/ByteBuffer.","Add a converter branch for the reported type (e.g. BigInteger for BIT columns, UUID) if extending the connector."],"exampleFix":"// before\n// BIT column -> BigInteger reaches BYTES converter -> throws\n// after\n// configure decimal.handling.mode / map column to BIGINT, or convert BigInteger -> byte[] in a custom converter","handlingStrategy":"type-guard","validationCode":"// Java\nstatic boolean isSupportedBytesValue(Object v) {\n    return v instanceof byte[] || v instanceof java.nio.ByteBuffer;\n}","typeGuard":"if (!(dbzObj instanceof byte[]) && !(dbzObj instanceof ByteBuffer)) {\n    log.warn(\"BYTES column value is {} — normalize it (byte[]/ByteBuffer) or change the column type\", dbzObj.getClass());\n}","tryCatchPattern":"try {\n    bytes = bytesConverter.convert(dbzObj);\n} catch (UnsupportedOperationException e) {\n    log.warn(\"BYTES value of unexpected type, mapping to null: {}\", e.getMessage());\n    bytes = null;\n}","preventionTips":["Set the Debezium binary/decimal handling modes so binary columns arrive as byte[] or ByteBuffer","Map exotic binary columns (BIT, UUID, geometry) to matching SeaTunnel types instead of BYTES","Inspect the actual Debezium value class for each binary column during schema design"],"tags":["cdc","bytes","unsupported-type","deserialization"],"backgroundTag":"unsupported-operation","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}