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 512a50751c1 [Chore](nereids) Remove DropRepositoryStmt (#53420)
512a50751c1 is described below

commit 512a50751c1fb3702ea38d3f4839dccd44e697d4
Author: csding <[email protected]>
AuthorDate: Wed Aug 6 16:47:37 2025 +0800

    [Chore](nereids) Remove DropRepositoryStmt (#53420)
---
 fe/fe-core/src/main/cup/sql_parser.cup             |  4 --
 .../apache/doris/analysis/DropRepositoryStmt.java  | 61 ----------------------
 .../org/apache/doris/backup/BackupHandler.java     |  8 +--
 .../main/java/org/apache/doris/qe/DdlExecutor.java |  3 --
 .../org/apache/doris/backup/BackupHandlerTest.java |  3 +-
 5 files changed, 2 insertions(+), 77 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index c6d974b2ee8..cd7f990a8a0 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -2591,10 +2591,6 @@ drop_stmt ::=
     {:
         RESULT = new DropTableStmt(ifExists, name, true, false);
     :}
-    | KW_DROP KW_REPOSITORY ident:repoName
-    {:
-        RESULT = new DropRepositoryStmt(repoName);
-    :}
     | KW_DROP KW_INDEX opt_if_exists:ifExists ident:indexName KW_ON 
table_name:tableName
     {:
         RESULT = new AlterTableStmt(tableName, Lists.newArrayList(new 
DropIndexClause(indexName, ifExists, tableName, false)));
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DropRepositoryStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/DropRepositoryStmt.java
deleted file mode 100644
index 0dcf0a848fc..00000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/DropRepositoryStmt.java
+++ /dev/null
@@ -1,61 +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.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 DropRepositoryStmt extends DdlStmt implements NotFallbackInParser 
{
-
-    private String repoName;
-
-    public DropRepositoryStmt(String repoName) {
-        this.repoName = repoName;
-    }
-
-    public String getRepoName() {
-        return repoName;
-    }
-
-    @Override
-    public void analyze() throws UserException {
-        super.analyze();
-
-        // check auth
-        if 
(!Env.getCurrentEnv().getAccessManager().checkGlobalPriv(ConnectContext.get(), 
PrivPredicate.ADMIN)) {
-            
ErrorReport.reportAnalysisException(ErrorCode.ERR_SPECIFIC_ACCESS_DENIED_ERROR, 
"ADMIN");
-        }
-    }
-
-    @Override
-    public String toSql() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("DROP ");
-        sb.append("REPOSITORY `").append(repoName).append("`");
-        return sb.toString();
-    }
-
-    @Override
-    public StmtType stmtType() {
-        return StmtType.DROP;
-    }
-}
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java 
b/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
index b1be7314c05..83cd86fee89 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/backup/BackupHandler.java
@@ -17,7 +17,6 @@
 
 package org.apache.doris.backup;
 
-import org.apache.doris.analysis.DropRepositoryStmt;
 import org.apache.doris.analysis.PartitionNames;
 import org.apache.doris.analysis.StorageBackend;
 import org.apache.doris.analysis.TableRef;
@@ -322,12 +321,7 @@ public class BackupHandler extends MasterDaemon implements 
Writable {
         }
     }
 
-    // handle drop repository stmt
-    public void dropRepository(DropRepositoryStmt stmt) throws DdlException {
-        dropRepository(stmt.getRepoName());
-    }
-
-    // handle drop repository stmt
+    // handle drop repository command
     public void dropRepository(String repoName) throws DdlException {
         tryLock();
         try {
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 c613c6d41eb..3e840d96da5 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
@@ -42,7 +42,6 @@ import org.apache.doris.analysis.DdlStmt;
 import org.apache.doris.analysis.DropCatalogStmt;
 import org.apache.doris.analysis.DropFunctionStmt;
 import org.apache.doris.analysis.DropIndexPolicyStmt;
-import org.apache.doris.analysis.DropRepositoryStmt;
 import org.apache.doris.analysis.DropSqlBlockRuleStmt;
 import org.apache.doris.analysis.DropTableStmt;
 import org.apache.doris.analysis.DropUserStmt;
@@ -144,8 +143,6 @@ public class DdlExecutor {
             env.recoverTable((RecoverTableStmt) ddlStmt);
         } else if (ddlStmt instanceof RecoverPartitionStmt) {
             env.recoverPartition((RecoverPartitionStmt) ddlStmt);
-        } else if (ddlStmt instanceof DropRepositoryStmt) {
-            env.getBackupHandler().dropRepository((DropRepositoryStmt) 
ddlStmt);
         } else if (ddlStmt instanceof SyncStmt) {
             return;
         } else if (ddlStmt instanceof InstallPluginStmt) {
diff --git 
a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java 
b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java
index 5fda00a8ca9..5991888d732 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java
@@ -17,7 +17,6 @@
 
 package org.apache.doris.backup;
 
-import org.apache.doris.analysis.DropRepositoryStmt;
 import org.apache.doris.analysis.StorageBackend;
 import org.apache.doris.catalog.BrokerMgr;
 import org.apache.doris.catalog.Database;
@@ -320,6 +319,6 @@ public class BackupHandlerTest {
         handler.cancel(new CancelBackupCommand(CatalogMocker.TEST_DB_NAME, 
true));
 
         // drop repo
-        handler.dropRepository(new DropRepositoryStmt("repo"));
+        handler.dropRepository("repo");
     }
 }


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

Reply via email to