the-other-tim-brown commented on code in PR #13714:
URL: https://github.com/apache/hudi/pull/13714#discussion_r2271853567


##########
hudi-common/src/main/java/org/apache/hudi/avro/HoodieAvroUtils.java:
##########
@@ -1434,10 +1437,18 @@ public static boolean 
recordNeedsRewriteForExtendedAvroTypePromotion(Schema writ
         return needsRewriteToString(writerSchema, true);
       case STRING:
       case BYTES:
+      case FIXED:
+        if (readerSchema.getLogicalType() != null) {
+          // check if logical types are equal
+          return 
!readerSchema.getLogicalType().equals(writerSchema.getLogicalType());
+        }
         return needsRewriteToString(writerSchema, false);
       case DOUBLE:
         // To maintain precision, you need to convert Float -> String -> Double
-        return writerSchema.getType().equals(Schema.Type.FLOAT);
+        return writerSchema.getType().equals(Schema.Type.FLOAT) && 
!writerSchema.getType().equals(Schema.Type.STRING);

Review Comment:
   If we can get this [PR](https://github.com/apache/hudi/pull/13654/files) in, 
I think the `areSchemasProjectionEquivalent` is going to fit the needs of this 
and has some better testing. I will wait to see if this can be brought into a 
mergable shape.  



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