From 4524764f1083c7144e97370346d217914deed48d Mon Sep 17 00:00:00 2001 From: Congxian Qiu Date: Wed, 16 Oct 2024 18:39:01 +0800 Subject: [PATCH 1/2] [AMORO-3065] Optimizing rest api efficiency for table detail (#3260) For table detail we'll retrive detail info from underlying table, before the change there will be two call to the catalog when loading the table: 1) check whether the database exists, 2) load the table for the detail info. After the change, the first call to catalog has been removed, and use the second call to check if the table exists. --- .../src/main/java/org/apache/amoro/CommonUnifiedCatalog.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/amoro-common/src/main/java/org/apache/amoro/CommonUnifiedCatalog.java b/amoro-common/src/main/java/org/apache/amoro/CommonUnifiedCatalog.java index 79b6e55be8..b49d860fbb 100644 --- a/amoro-common/src/main/java/org/apache/amoro/CommonUnifiedCatalog.java +++ b/amoro-common/src/main/java/org/apache/amoro/CommonUnifiedCatalog.java @@ -122,10 +122,6 @@ public void dropDatabase(String database) { @Override public AmoroTable loadTable(String database, String table) { - if (!databaseExists(database)) { - throw new NoSuchDatabaseException("Database: " + database + " does not exist."); - } - return formatCatalogAsOrder( TableFormat.MIXED_HIVE, TableFormat.MIXED_ICEBERG, From 8954349d975c7b8a7e924b9d70455aad173bf36f Mon Sep 17 00:00:00 2001 From: Darcy Date: Wed, 16 Oct 2024 18:44:29 +0800 Subject: [PATCH 2/2] Fix: The issue of startup failure caused by upgrading the iceberg version. (#3262) fix: The issue of startup failure caused by upgrading the iceberg version. --- .../amoro/server/optimizing/OptimizingQueue.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java b/amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java index 2dcfcaca86..fb844a41a5 100644 --- a/amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java +++ b/amoro-ams/src/main/java/org/apache/amoro/server/optimizing/OptimizingQueue.java @@ -666,12 +666,13 @@ private void cancelTasks() { } private void loadTaskRuntimes(OptimizingProcess optimizingProcess) { - List> taskRuntimes = - getAs( - OptimizingMapper.class, - mapper -> - mapper.selectTaskRuntimes(tableRuntime.getTableIdentifier().getId(), processId)); try { + List> taskRuntimes = + getAs( + OptimizingMapper.class, + mapper -> + mapper.selectTaskRuntimes( + tableRuntime.getTableIdentifier().getId(), processId)); Map inputs = TaskFilesPersistence.loadTaskInputs(processId); taskRuntimes.forEach( taskRuntime -> {