From 4177b09002c43169a05eeca3ee454d0f785796eb Mon Sep 17 00:00:00 2001 From: Jack Pickett Date: Tue, 3 Mar 2026 20:12:33 +0000 Subject: [PATCH] Handle Avro fixed field type in AvroInputCodec Added a case in convertRecordToMap to handle GenericData.Fixed. Previously, the use of the fixed field type in Avro schemas caused an exception. Now it is converted to a byte array and added to the map as expected. Signed-off-by: Jack Pickett --- .../dataprepper/plugins/codec/avro/AvroInputCodec.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data-prepper-plugins/avro-codecs/src/main/java/org/opensearch/dataprepper/plugins/codec/avro/AvroInputCodec.java b/data-prepper-plugins/avro-codecs/src/main/java/org/opensearch/dataprepper/plugins/codec/avro/AvroInputCodec.java index a8fc61e2fc..cb03946585 100644 --- a/data-prepper-plugins/avro-codecs/src/main/java/org/opensearch/dataprepper/plugins/codec/avro/AvroInputCodec.java +++ b/data-prepper-plugins/avro-codecs/src/main/java/org/opensearch/dataprepper/plugins/codec/avro/AvroInputCodec.java @@ -103,6 +103,10 @@ else if(value instanceof Utf8){ value = new String(utf8Bytes, "UTF-8"); } + else if(value instanceof GenericData.Fixed){ + value = ((GenericData.Fixed) value).bytes(); + } + eventData.put(field.name(), value); } return eventData;