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

baiyangtx 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 568feca22 [AMORO-2788]Fix failing to create unified catalog when 
managing more than one formats #2788 (#2800)
568feca22 is described below

commit 568feca2251e8df48be24dfefcc0eb2bcc2d7ad5
Author: Nico CHen <[email protected]>
AuthorDate: Wed May 1 11:39:23 2024 +0800

    [AMORO-2788]Fix failing to create unified catalog when managing more than 
one formats #2788 (#2800)
---
 .../server/dashboard/controller/CatalogController.java      | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)

diff --git 
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/CatalogController.java
 
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/CatalogController.java
index aaac36eeb..6b15ae7f1 100644
--- 
a/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/CatalogController.java
+++ 
b/amoro-ams/amoro-ams-server/src/main/java/org/apache/amoro/server/dashboard/controller/CatalogController.java
@@ -83,6 +83,7 @@ import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
+import java.util.stream.Collectors;
 
 /** The controller that handles catalog requests. */
 public class CatalogController {
@@ -357,18 +358,18 @@ public class CatalogController {
         .put(
             CatalogMetaProperties.TABLE_PROPERTIES_PREFIX + 
TableProperties.SELF_OPTIMIZING_GROUP,
             info.getOptimizerGroup());
-    StringBuilder tableFormats = new StringBuilder();
+    String tableFormats;
     try {
       // validate table format
-      info.getTableFormatList()
-          .forEach(item -> 
tableFormats.append(TableFormat.valueOf(item).name()));
+      tableFormats =
+          info.getTableFormatList().stream()
+              .map(item -> TableFormat.valueOf(item).name())
+              .collect(Collectors.joining(","));
     } catch (Exception e) {
       throw new RuntimeException(
           "Invalid table format list, " + String.join(",", 
info.getTableFormatList()));
     }
-    catalogMeta
-        .getCatalogProperties()
-        .put(CatalogMetaProperties.TABLE_FORMATS, tableFormats.toString());
+    
catalogMeta.getCatalogProperties().put(CatalogMetaProperties.TABLE_FORMATS, 
tableFormats);
     fillAuthConfigs2CatalogMeta(catalogMeta, info.getAuthConfig(), 
oldCatalogMeta);
     // change fileId to base64Code
     Map<String, String> metaStorageConfig = new HashMap<>();

Reply via email to