40
40
*/
41
41
public abstract class CaseTransform <R extends ConnectRecord <R >> implements Transformation <R > {
42
42
43
- private static final Logger LOGGER = LoggerFactory .getLogger (ConcatFields .class );
43
+ private static final Logger LOGGER = LoggerFactory .getLogger (CaseTransform .class );
44
44
45
45
/**
46
46
* The configuration for case transform.
@@ -60,13 +60,12 @@ public abstract class CaseTransform<R extends ConnectRecord<R>> implements Trans
60
60
61
61
/**
62
62
* Apply the case transformation to given new struct from the original struct field.
63
- * @param struct Original struct
64
63
* @param newStruct New struct
65
64
* @param fieldName The field name to case transform
66
65
*/
67
- private void applyStruct (final Struct struct , final Struct newStruct , final String fieldName ) {
66
+ private void applyStruct (final Struct newStruct , final String fieldName ) {
68
67
try {
69
- final Object value = struct .get (fieldName );
68
+ final Object value = newStruct .get (fieldName );
70
69
if (value == null ) {
71
70
newStruct .put (fieldName , null );
72
71
return ;
@@ -108,7 +107,7 @@ public R apply(final R record) {
108
107
newStruct .put (field .name (), struct .get (field ));
109
108
});
110
109
config .fieldNames ().forEach (field -> {
111
- applyStruct (struct , newStruct , field );
110
+ applyStruct (newStruct , field );
112
111
});
113
112
newRecord = createNewRecord (record , struct .schema (), newStruct );
114
113
} else if (schemaAndValue .value () instanceof Map ) {
0 commit comments