the-other-tim-brown commented on code in PR #13714:
URL: https://github.com/apache/hudi/pull/13714#discussion_r2271470055
##########
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);
+ case INT:
+ case LONG:
+ return writerSchema.getType().equals(Schema.Type.STRING);
Review Comment:
No, the return is `true` when a rewrite is required
--
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]