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


##########
hudi-common/src/main/java/org/apache/hudi/metadata/HoodieMetadataPayload.java:
##########
@@ -410,10 +417,9 @@ public Option<IndexedRecord> getInsertValue(Schema schema, 
Properties properties
       return Option.empty();
     }
 
-    // TODO: feature(schema): HoodieSchema change, we removed caching in a few 
areas, during the migration of Avro.Schema -> HoodieSchema.
-    // The schema objects might have been the same reference (due to caching), 
but now after converting from HoodieSchema to Avro Schema using .toAvroSchema(),
-    // it creates a new Schema object that's not the same reference as 
HOODIE_METADATA_SCHEMA
-    if (schema == null || HOODIE_METADATA_SCHEMA.equals(schema)) {
+    // TODO: feature(schema): Swap this over to HOODIE_METADATA_SCHEMA after 
HoodieRecordPayload implementations are using HoodieSchema
+    // Uses cached Avro schema reference for O(1) equality check.
+    if (schema == null || schema == HOODIE_METADATA_AVRO_SCHEMA) {

Review Comment:
   This perf regression was introduced in here intentionally when we were 
performing our Avro.Schema -> HoodieSchema migration.
   
   https://github.com/apache/hudi/pull/14340#discussion_r2599017511
   
   For this particular schema, from our scope of change, this should be the 
only one.



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