voonhous commented on code in PR #17581:
URL: https://github.com/apache/hudi/pull/17581#discussion_r2625641580


##########
hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/utils/HiveAvroSerializer.java:
##########
@@ -493,12 +499,16 @@ private static void 
copyOldValueOrSetDefault(GenericRecord oldRecord, GenericRec
       Object newFieldValue;
       if (fieldValue instanceof GenericRecord) {
         GenericRecord record = (GenericRecord) fieldValue;
-        newFieldValue = rewriteRecordIgnoreResultCheck(record, 
AvroSchemaUtils.resolveUnionSchema(field.schema(), 
record.getSchema().getFullName()));
+        HoodieSchema nonNullFieldSchema = field.schema().getNonNullType();
+        if (!Objects.equals(nonNullFieldSchema.getFullName(), 
record.getSchema().getFullName())) {

Review Comment:
   Double checking it, i did not account for complex unions with more than 3 
types, let me fix that.



-- 
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]

Reply via email to