You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "mfvitale (via GitHub)" <gi...@apache.org> on 2024/07/04 08:00:32 UTC

Re: [PR] KAFKA-15838: ExtractField and InsertField NULL Values are replaced by default value even in NULLABLE fields [kafka]

mfvitale commented on code in PR #15756:
URL: https://github.com/apache/kafka/pull/15756#discussion_r1665300188


##########
connect/transforms/src/test/java/org/apache/kafka/connect/transforms/SetSchemaMetadataTest.java:
##########
@@ -104,6 +115,38 @@ public void schemaNameAndVersionUpdateWithStruct() {
         assertMatchingSchema((Struct) updatedRecord.value(), updatedRecord.valueSchema());
     }
 
+    @ParameterizedTest
+    @MethodSource("data")
+    public void schemaNameAndVersionUpdateWithStructAndNullField(boolean replaceNullWithDefault, Object expectedValue) {
+        final String fieldName1 = "f1";
+        final String fieldName2 = "f2";
+        final int fieldValue2 = 1;
+        final Schema schema = SchemaBuilder.struct()
+                .name("my.orig.SchemaDefn")
+                .field(fieldName1, SchemaBuilder.string().defaultValue("default").optional().build())

Review Comment:
   I would like to differentiate with the `expectedValue` variable that can have different value based on the test. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org