voonhous commented on code in PR #19809:
URL: https://github.com/apache/hudi/pull/19809#discussion_r3905302470
##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieMetadataPayload.java:
##########
@@ -110,7 +109,7 @@ public class HoodieMetadataPayload implements
HoodieRecordPayload<HoodieMetadata
private static final HoodieSchema HOODIE_METADATA_SCHEMA =
HoodieSchemaCache.intern(
HoodieSchema.fromAvroSchema(HoodieMetadataRecord.getClassSchema()));
// Cache the Avro schema reference for O(1) equality checks during
Avro.Schema -> HoodieSchema migration
Review Comment:
Reworded in 557a2743c60e. The field still anchors the `==` fast path in
`getInsertValue` (line 428); `HoodieMetadataRecord.getClassSchema()` returns
the generated class's `SCHEMA$` singleton, so the reference is stable without
interning.
##########
hudi-common/src/main/java/org/apache/hudi/common/avro/HoodieAvroUtils.java:
##########
@@ -1581,15 +1631,17 @@ public static GenericRecord
rewriteRecordDeep(GenericRecord oldRecord, Schema ne
return rewriteRecordWithNewSchema(oldRecord, newSchema,
Collections.EMPTY_MAP, validate);
}
+ @VisibleForTesting
Review Comment:
Keeping it as is. `gteqAvro1_9` has test callers outside the package and
outside the module (`TestHoodieLogFormat` in hudi-hadoop-common,
`TestObjectSizeCalculator` in `common.util`), so package-private is not an
option, and the annotation is what records that the method is public only for
tests -- same pattern as `makeFieldNonNull` and `rewriteRecords` in this class.
`gteqAvro1_10` and `gteqAvro1_12` could be narrowed because their only callers
are in-package or in-class.
--
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]