KiteSoar commented on code in PR #17772: URL: https://github.com/apache/hudi/pull/17772#discussion_r2660090764
########## hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java: ########## @@ -18,6 +18,7 @@ package org.apache.hudi.common.model; +import org.apache.hudi.common.schema.HoodieSchema; Review Comment: I noticed that the inner class [EmptyRecord](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java#L556-L582) implements `GenericRecord` interface, which requires the [getSchema()](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-hadoop-mr/src/main/java/org/apache/hudi/hadoop/HoodieHiveRecord.java#L250-L252) method to return `org.apache.avro.Schema`. Currently, [SENTINEL](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java#L100-L100) (an instance of [EmptyRecord](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java#L556-L582)) is used throughout the codebase as a `GenericRecord` marker, for example: - In `BaseAvroPayload.getInsertValue()` where it returns [Option.of(SENTINEL)](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-io/src/main/java/org/apache/hudi/common/util/Option.java#L74-L76) - In [HoodieAvroIndexedRecord.shouldIgnore()](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieAvroIndexedRecord.java#L250-L254) where it checks [getData().equals(SENTINEL)](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/common/model/SerializableIndexedRecord.java#L104-L116) Could you clarify if you meant: 1. We should refactor [EmptyRecord](file:///Users/matthew/Desktop/Java%20Project/hudi/hudi-common/src/main/java/org/apache/hudi/common/model/HoodieRecord.java#L556-L582) to not implement `GenericRecord`? (This would require changes across the codebase) 2. We use the fully qualified name org.apache.avro.Schema in the getSchema() method 3. Or is there another approach you had in mind? -- 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]
