This is an automated email from the ASF dual-hosted git repository.
czy006 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 fc0c2e8e3 [AMORO-4343][ams] Fix runtime creation for unsupported table
formats (#4344)
fc0c2e8e3 is described below
commit fc0c2e8e3f6fd4e9966b405e709e7735c44a5cc9
Author: csurong <[email protected]>
AuthorDate: Mon Aug 31 19:35:51 2026 +0800
[AMORO-4343][ams] Fix runtime creation for unsupported table formats (#4344)
Fix runtime creation for unsupported table formats
Co-authored-by: caosurong <surong.cao>
---
.../amoro/server/table/DefaultTableService.java | 7 +++
.../table/TestSyncUnsupportedTableFormat.java | 59 ++++++++++++++++++++++
2 files changed, 66 insertions(+)
diff --git
a/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java
b/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java
index 6e916bfd7..f43b76242 100644
---
a/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java
+++
b/amoro-ams/src/main/java/org/apache/amoro/server/table/DefaultTableService.java
@@ -854,6 +854,13 @@ public class DefaultTableService extends PersistentBase
implements TableService
}
Map<String, String> properties = table.properties();
+ if (!tableRuntimeFactory.accept(serverTableIdentifier,
properties).isPresent()) {
+ LOG.debug(
+ "Skip creating table runtime for table {} because its format is not
supported",
+ serverTableIdentifier);
+ return false;
+ }
+
TableRuntimeMeta meta = new TableRuntimeMeta();
meta.setTableId(serverTableIdentifier.getId());
meta.setTableConfig(properties);
diff --git
a/amoro-ams/src/test/java/org/apache/amoro/server/table/TestSyncUnsupportedTableFormat.java
b/amoro-ams/src/test/java/org/apache/amoro/server/table/TestSyncUnsupportedTableFormat.java
new file mode 100644
index 000000000..af8d2eca8
--- /dev/null
+++
b/amoro-ams/src/test/java/org/apache/amoro/server/table/TestSyncUnsupportedTableFormat.java
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.amoro.server.table;
+
+import org.apache.amoro.ServerTableIdentifier;
+import org.apache.amoro.formats.paimon.PaimonHadoopCatalogTestHelper;
+import org.apache.amoro.server.catalog.ExternalCatalog;
+import org.apache.amoro.server.catalog.TableCatalogTestBase;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.List;
+
+public class TestSyncUnsupportedTableFormat extends TableCatalogTestBase {
+
+ private static final String TEST_DATABASE = "test_database";
+ private static final String TEST_TABLE = "test_table";
+
+ public TestSyncUnsupportedTableFormat() {
+ super(PaimonHadoopCatalogTestHelper.defaultHelper());
+ }
+
+ @Before
+ public void createPaimonTable() throws Exception {
+ getAmoroCatalog().createDatabase(TEST_DATABASE);
+ getAmoroCatalogTestHelper().createTable(TEST_DATABASE, TEST_TABLE);
+ }
+
+ @Test
+ public void
unsupportedTableFormatDoesNotCreateRuntimeDuringRepeatedSynchronization() {
+ ExternalCatalog externalCatalog =
+ (ExternalCatalog)
+
CATALOG_MANAGER.getServerCatalog(getAmoroCatalogTestHelper().catalogName());
+
+ tableService().exploreExternalCatalog(externalCatalog);
+ tableService().exploreExternalCatalog(externalCatalog);
+
+ List<ServerTableIdentifier> managedTables =
tableManager().listManagedTables();
+ Assert.assertEquals(1, managedTables.size());
+
Assert.assertNull(tableManager().getTableRuntimeMata(managedTables.get(0)));
+ }
+}