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

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


The following commit(s) were added to refs/heads/master by this push:
     new a648a76dc [Hotfix] Meet NPE when loading tables which use s3 storage 
(#3007)
a648a76dc is described below

commit a648a76dc964a4bdf37fb617cfd83da1fa981af0
Author: tcodehuber <[email protected]>
AuthorDate: Fri Jul 5 14:26:15 2024 +0800

    [Hotfix] Meet NPE when loading tables which use s3 storage (#3007)
---
 .../src/main/java/org/apache/amoro/table/TableMetaStore.java      | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/amoro-core/src/main/java/org/apache/amoro/table/TableMetaStore.java 
b/amoro-core/src/main/java/org/apache/amoro/table/TableMetaStore.java
index 0f44548d0..b3ab1793e 100644
--- a/amoro-core/src/main/java/org/apache/amoro/table/TableMetaStore.java
+++ b/amoro-core/src/main/java/org/apache/amoro/table/TableMetaStore.java
@@ -510,8 +510,12 @@ public class TableMetaStore implements Serializable {
 
     private Configuration buildConfiguration(TableMetaStore metaStore) {
       Configuration configuration = new Configuration();
-      configuration.addResource(new 
ByteArrayInputStream(metaStore.getCoreSite()));
-      configuration.addResource(new 
ByteArrayInputStream(metaStore.getHdfsSite()));
+      if (!ArrayUtils.isEmpty(metaStore.getCoreSite())) {
+        configuration.addResource(new 
ByteArrayInputStream(metaStore.getCoreSite()));
+      }
+      if (!ArrayUtils.isEmpty(metaStore.getHdfsSite())) {
+        configuration.addResource(new 
ByteArrayInputStream(metaStore.getHdfsSite()));
+      }
       if (!ArrayUtils.isEmpty(metaStore.getMetaStoreSite())) {
         configuration.addResource(new 
ByteArrayInputStream(metaStore.getMetaStoreSite()));
       }

Reply via email to