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

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


The following commit(s) were added to refs/heads/master by this push:
     new 11e18f4c98 [Fix](multi-catalog) fix NPE for FileCacheValue. (#21441)
11e18f4c98 is described below

commit 11e18f4c98aca5630a5be783919d1c1e54a2d85e
Author: Xiangyu Wang <[email protected]>
AuthorDate: Mon Jul 3 23:38:58 2023 +0800

    [Fix](multi-catalog) fix NPE for FileCacheValue. (#21441)
    
    FileCacheValue.files may be null if there is not any files exists for some 
partitions.
---
 .../org/apache/doris/datasource/hive/HiveMetaStoreCache.java   | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
index 0267668ed3..2859dd8549 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/datasource/hive/HiveMetaStoreCache.java
@@ -917,9 +917,9 @@ public class HiveMetaStoreCache {
     @Data
     public static class FileCacheValue {
         // File Cache for self splitter.
-        private List<HiveFileStatus> files;
+        private final List<HiveFileStatus> files = Lists.newArrayList();
         // File split cache for old splitter. This is a temp variable.
-        private List<Split> splits;
+        private final List<Split> splits = Lists.newArrayList();
         private boolean isSplittable;
         // The values of partitions.
         // e.g for file : hdfs://path/to/table/part1=a/part2=b/datafile
@@ -929,9 +929,6 @@ public class HiveMetaStoreCache {
         private AcidInfo acidInfo;
 
         public void addFile(RemoteFile file) {
-            if (files == null) {
-                files = Lists.newArrayList();
-            }
             HiveFileStatus status = new HiveFileStatus();
             status.setBlockLocations(file.getBlockLocations());
             status.setPath(file.getPath());
@@ -942,9 +939,6 @@ public class HiveMetaStoreCache {
         }
 
         public void addSplit(Split split) {
-            if (splits == null) {
-                splits = Lists.newArrayList();
-            }
             splits.add(split);
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to