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


##########
hudi-flink-datasource/hudi-flink/src/main/java/org/apache/hudi/table/format/FlinkRowDataReaderContext.java:
##########
@@ -148,35 +149,26 @@ public String getRecordKey(RowData record, Schema schema) 
{
   }
 
   @Override
-  public HoodieRecord<RowData> constructHoodieRecord(Option<RowData> 
recordOption, Map<String, Object> metadataMap) {
-    HoodieKey hoodieKey = new HoodieKey(
-        (String) metadataMap.get(INTERNAL_META_RECORD_KEY),
-        (String) metadataMap.get(INTERNAL_META_PARTITION_PATH));
-    RowData rowData = recordOption.get();
+  public HoodieRecord<RowData> constructHoodieRecord(BufferedRecord<RowData> 
bufferedRecord) {
+    HoodieKey hoodieKey = new HoodieKey(bufferedRecord.getRecordKey(), null);
     // delete record
-    if (recordOption.isEmpty()) {
-      Comparable orderingValue;
-      if (metadataMap.containsKey(INTERNAL_META_ORDERING_FIELD)) {
-        orderingValue = (Comparable) 
metadataMap.get(INTERNAL_META_ORDERING_FIELD);
-      } else {
-        throw new HoodieException("There should be ordering value in 
metadataMap.");
-      }
+    if (bufferedRecord.isDelete()) {
+      Comparable orderingValue = bufferedRecord.getOrderingValue();
       return new HoodieEmptyRecord<>(hoodieKey, HoodieOperation.DELETE, 
orderingValue, HoodieRecord.HoodieRecordType.FLINK);
     }
-    return new HoodieFlinkRecord(hoodieKey, rowData);
+    return new HoodieFlinkRecord(hoodieKey, bufferedRecord.getRecord());

Review Comment:
   do we need to set up the ordering value to avoid redundant computation in 
the merger.



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