yihua commented on code in PR #13711:
URL: https://github.com/apache/hudi/pull/13711#discussion_r2352874709
##########
hudi-common/src/main/java/org/apache/hudi/avro/AvroSchemaUtils.java:
##########
@@ -423,22 +428,24 @@ private static Schema pruneDataSchemaInternal(Schema
dataSchema, Schema required
}
List<Schema.Field> newFields = new ArrayList<>();
for (Schema.Field requiredSchemaField : requiredSchema.getFields()) {
- Schema.Field dataSchemaField =
dataSchema.getField(requiredSchemaField.name());
- if (dataSchemaField != null) {
- Schema.Field newField = new Schema.Field(
- dataSchemaField.name(),
- pruneDataSchema(dataSchemaField.schema(),
requiredSchemaField.schema(), Collections.emptySet()),
- dataSchemaField.doc(),
- dataSchemaField.defaultVal()
- );
- newFields.add(newField);
- } else if (mandatoryFields.contains(requiredSchemaField.name())) {
+ if (mandatoryFields.contains(requiredSchemaField.name())) {
Review Comment:
What is the case where the behavior is changed? Add a unit test on that
case (I see `TestAvroSchemaUtils` with tests covering this method is not
change)?
--
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]