You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by yi...@apache.org on 2023/02/05 02:17:52 UTC

[hudi] 06/06: [HUDI-5702] Avoid to write useless change-data when compaction (#7849)

This is an automated email from the ASF dual-hosted git repository.

yihua pushed a commit to branch release-0.13.0
in repository https://gitbox.apache.org/repos/asf/hudi.git

commit 2b17dd58243e6b688a2e1927748479809437a1a4
Author: Yann Byron <bi...@gmail.com>
AuthorDate: Sun Feb 5 08:06:05 2023 +0800

    [HUDI-5702] Avoid to write useless change-data when compaction (#7849)
    
    
    Co-authored-by: Raymond Xu <27...@users.noreply.github.com>
---
 .../org/apache/hudi/io/HoodieMergeHandleFactory.java   | 18 ++++--------------
 1 file changed, 4 insertions(+), 14 deletions(-)

diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandleFactory.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandleFactory.java
index b110c2c0817..8aadd637f0e 100644
--- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandleFactory.java
+++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/io/HoodieMergeHandleFactory.java
@@ -80,21 +80,11 @@ public class HoodieMergeHandleFactory {
       TaskContextSupplier taskContextSupplier,
       Option<BaseKeyGenerator> keyGeneratorOpt) {
     if (table.requireSortedRecords()) {
-      if (table.getMetaClient().getTableConfig().isCDCEnabled()) {
-        return new HoodieSortedMergeHandleWithChangeLog<>(writeConfig, instantTime, table, keyToNewRecords, partitionPath, fileId,
-            dataFileToBeMerged, taskContextSupplier, keyGeneratorOpt);
-      } else {
-        return new HoodieSortedMergeHandle<>(writeConfig, instantTime, table, keyToNewRecords, partitionPath, fileId,
-            dataFileToBeMerged, taskContextSupplier, keyGeneratorOpt);
-      }
+      return new HoodieSortedMergeHandle<>(writeConfig, instantTime, table, keyToNewRecords, partitionPath, fileId,
+          dataFileToBeMerged, taskContextSupplier, keyGeneratorOpt);
     } else {
-      if (table.getMetaClient().getTableConfig().isCDCEnabled()) {
-        return new HoodieMergeHandleWithChangeLog<>(writeConfig, instantTime, table, keyToNewRecords, partitionPath, fileId,
-            dataFileToBeMerged, taskContextSupplier, keyGeneratorOpt);
-      } else {
-        return new HoodieMergeHandle<>(writeConfig, instantTime, table, keyToNewRecords, partitionPath, fileId,
-            dataFileToBeMerged, taskContextSupplier, keyGeneratorOpt);
-      }
+      return new HoodieMergeHandle<>(writeConfig, instantTime, table, keyToNewRecords, partitionPath, fileId,
+          dataFileToBeMerged, taskContextSupplier, keyGeneratorOpt);
     }
   }
 }