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

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


The following commit(s) were added to refs/heads/master by this push:
     new 72636a0b029 [Chore](nereids) Remove DropEncryptKeyStmt (#54245)
72636a0b029 is described below

commit 72636a0b029de3532f53f6de4205652d95d10e62
Author: csding <[email protected]>
AuthorDate: Tue Aug 5 11:12:35 2025 +0800

    [Chore](nereids) Remove DropEncryptKeyStmt (#54245)
---
 fe/fe-core/src/main/cup/sql_parser.cup             |  4 --
 .../apache/doris/analysis/DropEncryptKeyStmt.java  | 75 ----------------------
 .../org/apache/doris/catalog/EncryptKeyHelper.java |  7 --
 .../main/java/org/apache/doris/qe/DdlExecutor.java |  3 -
 4 files changed, 89 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 7b37cf7f4d1..3bd92991770 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -2619,10 +2619,6 @@ drop_stmt ::=
     {:
         RESULT = new DropWorkloadSchedPolicyStmt(ifExists, policyName);
     :}
-    | KW_DROP KW_ENCRYPTKEY opt_if_exists:ifExists encryptkey_name:keyName
-    {:
-        RESULT = new DropEncryptKeyStmt(ifExists, keyName);
-    :}
     | KW_DROP KW_SQL_BLOCK_RULE opt_if_exists:ifExists ident_list:ruleNames
     {:
         RESULT = new DropSqlBlockRuleStmt(ifExists, ruleNames);
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DropEncryptKeyStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/DropEncryptKeyStmt.java
deleted file mode 100644
index cd2ac826eba..00000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DropEncryptKeyStmt.java
+++ /dev/null
@@ -1,75 +0,0 @@
-// 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.doris.analysis;
-
-import org.apache.doris.catalog.EncryptKeySearchDesc;
-import org.apache.doris.catalog.Env;
-import org.apache.doris.common.ErrorCode;
-import org.apache.doris.common.ErrorReport;
-import org.apache.doris.common.UserException;
-import org.apache.doris.mysql.privilege.PrivPredicate;
-import org.apache.doris.qe.ConnectContext;
-
-public class DropEncryptKeyStmt extends DdlStmt implements NotFallbackInParser 
{
-    private final boolean ifExists;
-    private final EncryptKeyName encryptKeyName;
-    private EncryptKeySearchDesc encryptKeySearchDesc;
-
-    public DropEncryptKeyStmt(boolean ifExists, EncryptKeyName encryptKeyName) 
{
-        this.ifExists = ifExists;
-        this.encryptKeyName = encryptKeyName;
-    }
-
-    public boolean isIfExists() {
-        return ifExists;
-    }
-
-    public EncryptKeyName getEncryptKeyName() {
-        return encryptKeyName;
-    }
-
-    public EncryptKeySearchDesc getEncryptKeysSearchDesc() {
-        return encryptKeySearchDesc;
-    }
-
-    @Override
-    public void analyze() throws UserException {
-        super.analyze();
-
-        // check operation privilege
-        if 
(!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(), 
PrivPredicate.ADMIN)) {
-            
ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, 
"ADMIN");
-        }
-
-        // analyze encryptkey name
-        encryptKeyName.analyze();
-        encryptKeySearchDesc = new EncryptKeySearchDesc(encryptKeyName);
-    }
-
-    @Override
-    public String toSql() {
-        StringBuilder stringBuilder = new StringBuilder();
-        stringBuilder.append("DROP ENCRYPTKEY 
").append(encryptKeyName.getKeyName());
-        return stringBuilder.toString();
-    }
-
-    @Override
-    public StmtType stmtType() {
-        return StmtType.DROP;
-    }
-}
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/catalog/EncryptKeyHelper.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/EncryptKeyHelper.java
index 934dd22f3a5..8aebc90d6d8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/EncryptKeyHelper.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/EncryptKeyHelper.java
@@ -18,7 +18,6 @@
 package org.apache.doris.catalog;
 
 import org.apache.doris.analysis.CreateEncryptKeyStmt;
-import org.apache.doris.analysis.DropEncryptKeyStmt;
 import org.apache.doris.analysis.EncryptKeyName;
 import org.apache.doris.common.MetaNotFoundException;
 import org.apache.doris.common.UserException;
@@ -48,12 +47,6 @@ public class EncryptKeyHelper {
         db.replayAddEncryptKey(encryptKey);
     }
 
-    public static void dropEncryptKey(DropEncryptKeyStmt stmt) throws 
UserException {
-        EncryptKeyName name = stmt.getEncryptKeyName();
-        Database db = 
Env.getCurrentInternalCatalog().getDbOrDdlException(name.getDb());
-        db.dropEncryptKey(stmt.getEncryptKeysSearchDesc(), stmt.isIfExists());
-    }
-
     public static void replayDropEncryptKey(EncryptKeySearchDesc 
encryptKeySearchDesc) throws MetaNotFoundException {
         String dbName = encryptKeySearchDesc.getKeyEncryptKeyName().getDb();
         Database db = 
Env.getCurrentInternalCatalog().getDbOrMetaException(dbName);
diff --git a/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java 
b/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java
index 4df7c9bc924..6500fadbe49 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/qe/DdlExecutor.java
@@ -41,7 +41,6 @@ import org.apache.doris.analysis.CreateTableStmt;
 import org.apache.doris.analysis.CreateWorkloadSchedPolicyStmt;
 import org.apache.doris.analysis.DdlStmt;
 import org.apache.doris.analysis.DropCatalogStmt;
-import org.apache.doris.analysis.DropEncryptKeyStmt;
 import org.apache.doris.analysis.DropFunctionStmt;
 import org.apache.doris.analysis.DropIndexPolicyStmt;
 import org.apache.doris.analysis.DropRepositoryStmt;
@@ -95,8 +94,6 @@ public class DdlExecutor {
             env.dropFunction((DropFunctionStmt) ddlStmt);
         } else if (ddlStmt instanceof CreateEncryptKeyStmt) {
             EncryptKeyHelper.createEncryptKey((CreateEncryptKeyStmt) ddlStmt);
-        } else if (ddlStmt instanceof DropEncryptKeyStmt) {
-            EncryptKeyHelper.dropEncryptKey((DropEncryptKeyStmt) ddlStmt);
         } else if (ddlStmt instanceof CreateTableStmt) {
             env.createTable((CreateTableStmt) ddlStmt);
         } else if (ddlStmt instanceof DropTableStmt) {


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to