yihua commented on code in PR #11943:
URL: https://github.com/apache/hudi/pull/11943#discussion_r1811596411


##########
hudi-common/src/main/java/org/apache/hudi/common/table/read/HoodieBaseFileGroupRecordBuffer.java:
##########
@@ -84,23 +96,24 @@ public abstract class HoodieBaseFileGroupRecordBuffer<T> 
implements HoodieFileGr
 
   public HoodieBaseFileGroupRecordBuffer(HoodieReaderContext<T> readerContext,
                                          HoodieTableMetaClient 
hoodieTableMetaClient,
+                                         RecordMergeMode recordMergeMode,
                                          Option<String> 
partitionNameOverrideOpt,
                                          Option<String[]> 
partitionPathFieldOpt,
-                                         HoodieRecordMerger recordMerger,
                                          TypedProperties props) {
     this.readerContext = readerContext;
     this.readerSchema = readerContext.getSchemaHandler().getRequiredSchema();
     this.partitionNameOverrideOpt = partitionNameOverrideOpt;
     this.partitionPathFieldOpt = partitionPathFieldOpt;
-    this.recordMergeMode = getRecordMergeMode(props);
-    this.recordMerger = recordMerger;
+    this.recordMergeMode = recordMergeMode;
+    this.recordMerger = readerContext.getRecordMerger();
+    if (recordMerger.isPresent() && 
recordMerger.get().getMergingStrategy().equals(PAYLOAD_BASED_MERGER_STRATEGY_UUID))
 {
+      this.payloadClass = Option.of(ConfigUtils.getAvroPayloadClass(props));
+    } else {
+      this.payloadClass = Option.empty();
+    }
     this.orderingFieldName = 
Option.ofNullable(ConfigUtils.getOrderingField(props)).orElseGet(() -> 
hoodieTableMetaClient.getTableConfig().getPreCombineField());
-    this.orderingFieldType = AvroSchemaUtils.findNestedFieldType(readerSchema, 
this.orderingFieldName).orElse(Schema.Type.INT);
+    this.orderingFieldType = AvroSchemaUtils.findNestedFieldType(readerSchema, 
this.orderingFieldName).orElse(Schema.Type.STRING);

Review Comment:
   After reading the code, the logic looks good to me as the 
`orderingFieldDefault` is used to assign the ordering value on the reader path 
only right now and it is used if the ordering field is not set.



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