moggaa commented on code in PR #17653:
URL: https://github.com/apache/iceberg/pull/17653#discussion_r4121966931
##########
kafka-connect/kafka-connect/src/main/java/org/apache/iceberg/connect/data/RecordConverter.java:
##########
@@ -259,7 +259,7 @@ private GenericRecord convertToStruct(
hasSchemaUpdates = true;
}
}
- Object recordFieldValue = struct.get(recordField);
+ Object recordFieldValue = fieldValue(struct, recordField);
Review Comment:
Good catch on the reachability — with the option off, a null on a field with
a default does now enter this branch. I verified what the branch emits, though,
and it is driven by the record schema, not the value: when the table schema
matches, the walk emits nothing, and when the record schema has drifted it
emits exactly the same events the default-substitution path produces by
recursing into the default value (which conforms to the same schema).
makeOptional behaves the same way, value-independent. Added both tests in
770c46a96: `testNoSchemaEvolutionStructWithNullValueOfFieldWithDefault` asserts
no events fire in the steady state, and
`testNestedSchemaEvolutionStructWithNullValueOfFieldWithDefault` asserts the
drifted case emits the same single addColumn under both option values. I'd
avoid a guard: it would silently drop schema discovery for null-with-default
fields, which the old path performed via the default value.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]