From 1bde8223eca60dde8b23b896e8c1ed6d06409297 Mon Sep 17 00:00:00 2001 From: Jason Separovic Date: Sat, 20 Jan 2024 08:44:42 -0800 Subject: [PATCH] fix: use outputFieldName instead of innerFieldName for output field (#109) Co-authored-by: Jason Separovic --- .../kafka/connect/transform/common/ExtractNestedField.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/ExtractNestedField.java b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/ExtractNestedField.java index acf2d8e..1afca3e 100644 --- a/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/ExtractNestedField.java +++ b/src/main/java/com/github/jcustenborder/kafka/connect/transform/common/ExtractNestedField.java @@ -71,7 +71,7 @@ protected SchemaAndValue processStruct(R record, Schema inputSchema, Struct inpu for (Field inputField : inputSchema.fields()) { builder.field(inputField.name(), inputField.schema()); } - builder.field(this.config.innerFieldName, innerField.schema()); + builder.field(this.config.outputFieldName, innerField.schema()); return builder.build(); }); final Struct outputStruct = new Struct(outputSchema); @@ -80,7 +80,7 @@ protected SchemaAndValue processStruct(R record, Schema inputSchema, Struct inpu outputStruct.put(inputField.name(), value); } final Object innerFieldValue = innerStruct.get(this.config.innerFieldName); - outputStruct.put(this.config.innerFieldName, innerFieldValue); + outputStruct.put(this.config.outputFieldName, innerFieldValue); return new SchemaAndValue(outputSchema, outputStruct);