danny0405 commented on code in PR #14120:
URL: https://github.com/apache/hudi/pull/14120#discussion_r2453761184
##########
hudi-common/src/main/java/org/apache/hudi/common/table/log/block/HoodieAvroDataBlock.java:
##########
@@ -187,11 +188,12 @@ private RecordIterator(Schema readerSchema, Schema
writerSchema, byte[] content)
this.totalRecords = this.dis.readInt();
}
- if (recordNeedsRewriteForExtendedAvroTypePromotion(writerSchema,
readerSchema)) {
- this.reader = new GenericDatumReader<>(writerSchema, writerSchema);
+ Schema repairedWriterSchema =
AvroSchemaRepair.repairLogicalTypes(writerSchema, readerSchema);
Review Comment:
yeah, looks like if there is no schema evolution, the read schema is right:
https://github.com/apache/hudi/blob/5fe72cba196021cdb32f5672c9b37838d07a86c9/hudi-common/src/main/java/org/apache/hudi/common/table/log/HoodieLogFileReader.java#L223,
otherwise the read schema would be empty and set as the header schema in the
`HoodieDataBlock` constructors.
And we should invoke `AvroSchemaRepair.repairLogicalTypes(` after checking
`recordNeedsRewriteForExtendedAvroTypePromotion` as true because micros to
millis check is added there?
--
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]