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

lzljs3620320 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new 2eca3a7e9 [Bug] Fix the NPE when report the statistic with 
DeletionFile (#4485)
2eca3a7e9 is described below

commit 2eca3a7e98ccd6a3efd084cd03dec3a3663a5088
Author: WenjunMin <[email protected]>
AuthorDate: Fri Nov 8 17:07:23 2024 +0800

    [Bug] Fix the NPE when report the statistic with DeletionFile (#4485)
---
 .../org/apache/paimon/flink/sink/partition/HmsReporter.java   | 11 +----------
 1 file changed, 1 insertion(+), 10 deletions(-)

diff --git 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/HmsReporter.java
 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/HmsReporter.java
index e6b6c4983..eb965aa3a 100644
--- 
a/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/HmsReporter.java
+++ 
b/paimon-flink/paimon-flink-common/src/main/java/org/apache/paimon/flink/sink/partition/HmsReporter.java
@@ -24,7 +24,6 @@ import org.apache.paimon.io.DataFileMeta;
 import org.apache.paimon.metastore.MetastoreClient;
 import org.apache.paimon.table.FileStoreTable;
 import org.apache.paimon.table.source.DataSplit;
-import org.apache.paimon.table.source.DeletionFile;
 import org.apache.paimon.table.source.ScanMode;
 import org.apache.paimon.table.source.snapshot.SnapshotReader;
 import org.apache.paimon.utils.Preconditions;
@@ -86,14 +85,6 @@ public class HmsReporter implements Closeable {
                 for (DataFileMeta fileMeta : fileMetas) {
                     totalSize += fileMeta.fileSize();
                 }
-
-                if (split.deletionFiles().isPresent()) {
-                    fileCount += split.deletionFiles().get().size();
-                    totalSize +=
-                            split.deletionFiles().get().stream()
-                                    .map(DeletionFile::length)
-                                    .reduce(0L, Long::sum);
-                }
             }
             Map<String, String> statistic = new HashMap<>();
             statistic.put(NUM_FILES_PROP, String.valueOf(fileCount));
@@ -101,7 +92,7 @@ public class HmsReporter implements Closeable {
             statistic.put(NUM_ROWS_PROP, String.valueOf(rowCount));
             statistic.put(HIVE_LAST_UPDATE_TIME_PROP, 
String.valueOf(modifyTime / 1000));
 
-            LOG.info("alter partition {} with statistic {}.", partition, 
statistic);
+            LOG.info("alter partition {} with statistic {}.", partitionSpec, 
statistic);
             metastoreClient.alterPartition(partitionSpec, statistic, 
modifyTime);
         }
     }

Reply via email to