danny0405 commented on code in PR #13699:
URL: https://github.com/apache/hudi/pull/13699#discussion_r2265620544


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/buffer/StreamingFileGroupRecordBufferLoader.java:
##########
@@ -51,19 +53,20 @@
  * @param <T> Engine native presentation of the record.
  */
 public class StreamingFileGroupRecordBufferLoader<T> implements 
FileGroupRecordBufferLoader<T> {
-  private static final StreamingFileGroupRecordBufferLoader INSTANCE = new 
StreamingFileGroupRecordBufferLoader<>();
+  private final Schema recordSchema;
 
-  static <T> StreamingFileGroupRecordBufferLoader<T> getInstance() {
-    return INSTANCE;
+  StreamingFileGroupRecordBufferLoader(Schema recordSchema) {
+    this.recordSchema = recordSchema;

Review Comment:
   there is no need to pass around the schema explicitly, it is actually the 
writeSchema, which equals to:
   `schemaHandler.requestedSchema - metadata fields`, we already have utility 
method for it: `HoodieAvroUtils.removeMetadataFields`.



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