From 448114da4e92125e16985a9c7ef4616e684b97e3 Mon Sep 17 00:00:00 2001 From: Calvin Kirs Date: Fri, 8 Nov 2024 10:02:30 +0800 Subject: [PATCH] Revert "[feat](catalog)Support Pre-Execution Authentication for HMS Type Iceberg Catalog Operations" This reverts commit d90b6087ed528d70517e8195fca84ccc7ba5b598. --- .../authentication/PreExecutionAuthenticator.java | 4 ---- .../doris/datasource/iceberg/IcebergMetadataOps.java | 10 ++++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/PreExecutionAuthenticator.java b/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/PreExecutionAuthenticator.java index cfdb90ec45d941..6260833b7db558 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/PreExecutionAuthenticator.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/security/authentication/PreExecutionAuthenticator.java @@ -37,10 +37,6 @@ public class PreExecutionAuthenticator { * Default constructor for PreExecutionAuthenticator. * This allows setting the HadoopAuthenticator at a later point if needed. */ - public PreExecutionAuthenticator(HadoopAuthenticator authenticator) { - this.hadoopAuthenticator = authenticator; - } - public PreExecutionAuthenticator() { } diff --git a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java index 295f6e2ab582b2..c1fbaee7fee7f8 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java +++ b/fe/fe-core/src/main/java/org/apache/doris/datasource/iceberg/IcebergMetadataOps.java @@ -28,6 +28,7 @@ import org.apache.doris.common.ErrorCode; import org.apache.doris.common.ErrorReport; import org.apache.doris.common.UserException; +import org.apache.doris.common.security.authentication.PreExecutionAuthenticator; import org.apache.doris.datasource.DorisTypeVisitor; import org.apache.doris.datasource.ExternalCatalog; import org.apache.doris.datasource.ExternalDatabase; @@ -114,7 +115,8 @@ public void createDb(CreateDbStmt stmt) throws DdlException { }); } catch (Exception e) { - throw new DdlException("Failed to create database: " + stmt.getFullDbName(), e); + throw new DdlException("Failed to create database: " + + stmt.getFullDbName() + " ,error message is: " + e.getMessage()); } } @@ -147,7 +149,7 @@ public void dropDb(DropDbStmt stmt) throws DdlException { return null; }); } catch (Exception e) { - throw new DdlException("Failed to drop database: " + stmt.getDbName(), e); + throw new DdlException("Failed to drop database: " + stmt.getDbName() + " ,error message is: ", e); } } @@ -171,7 +173,7 @@ public boolean createTable(CreateTableStmt stmt) throws UserException { try { preExecutionAuthenticator.execute(() -> performCreateTable(stmt)); } catch (Exception e) { - throw new DdlException("Failed to create table: " + stmt.getTableName(), e); + throw new DdlException("Failed to create table: " + stmt.getTableName() + " ,error message is:", e); } return false; } @@ -215,7 +217,7 @@ public void dropTable(DropTableStmt stmt) throws DdlException { return null; }); } catch (Exception e) { - throw new DdlException("Failed to drop table: " + stmt.getTableName(), e); + throw new DdlException("Failed to drop table: " + stmt.getTableName() + " ,error message is:", e); } }