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 b440e68dfd0 [Chore](nereids) remove AlterRepositoryStmt (#54472)
b440e68dfd0 is described below

commit b440e68dfd01533b0ca449ebbff46ce2badccd4b
Author: yaoxiao <[email protected]>
AuthorDate: Fri Aug 8 10:36:03 2025 +0800

    [Chore](nereids) remove AlterRepositoryStmt (#54472)
---
 fe/fe-core/src/main/cup/sql_parser.cup             |  4 -
 .../apache/doris/analysis/AlterRepositoryStmt.java | 91 ----------------------
 .../main/java/org/apache/doris/qe/DdlExecutor.java |  5 --
 3 files changed, 100 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 2cb05b7a7b8..05bb3a10788 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -1279,10 +1279,6 @@ alter_stmt ::=
         ModifyTablePropertiesClause clause = new 
ModifyTablePropertiesClause(properties);
         RESULT = new AlterTableStmt(tbl, Lists.newArrayList(clause));
     :}
-    | KW_ALTER KW_REPOSITORY ident:repoName opt_properties:properties
-    {:
-        RESULT = new AlterRepositoryStmt(repoName, properties);
-    :}
     ;
 
 opt_datasource_properties ::=
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterRepositoryStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterRepositoryStmt.java
deleted file mode 100644
index 9e7c5e3bbb7..00000000000
--- 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/AlterRepositoryStmt.java
+++ /dev/null
@@ -1,91 +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.FeNameFormat;
-import org.apache.doris.common.UserException;
-import org.apache.doris.common.util.PrintableMap;
-import org.apache.doris.datasource.property.constants.S3Properties;
-import org.apache.doris.mysql.privilege.PrivPredicate;
-import org.apache.doris.qe.ConnectContext;
-
-import com.google.common.collect.Maps;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class AlterRepositoryStmt extends DdlStmt implements 
NotFallbackInParser {
-    private String name;
-    private Map<String, String> properties;
-
-    public AlterRepositoryStmt(String name, Map<String, String> properties) {
-        this.name = name;
-        this.properties = properties;
-        if (this.properties == null) {
-            this.properties = Maps.newHashMap();
-        }
-    }
-
-    public Map<String, String> getProperties() {
-        return properties;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    @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");
-        }
-        FeNameFormat.checkRepositoryName(name);
-        Map<String, String> copyProperties = new HashMap<>(properties);
-        if (copyProperties.size() == 0) {
-            throw new UserException("alter repository need contains 
ak/sk/token info of s3.");
-        }
-        copyProperties.remove(S3Properties.ACCESS_KEY);
-        copyProperties.remove(S3Properties.SECRET_KEY);
-        copyProperties.remove(S3Properties.SESSION_TOKEN);
-        copyProperties.remove(S3Properties.Env.ACCESS_KEY);
-        copyProperties.remove(S3Properties.Env.SECRET_KEY);
-        copyProperties.remove(S3Properties.Env.TOKEN);
-        if (copyProperties.size() != 0) {
-            throw new UserException("alter repository only support ak/sk/token 
info of s3."
-                + " unsupported properties: " + copyProperties.keySet());
-        }
-    }
-
-    @Override
-    public String toSql() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("ALTER REPOSITORY '").append(name).append("' ");
-        sb.append("PROPERTIES(").append(new PrintableMap<>(properties, " = ", 
true, false)).append(")");
-        return sb.toString();
-    }
-
-    @Override
-    public StmtType stmtType() {
-        return StmtType.ALTER;
-    }
-}
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 d35591c7012..f5ad0fc8d26 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
@@ -19,7 +19,6 @@ package org.apache.doris.qe;
 
 import org.apache.doris.analysis.AdminSetPartitionVersionStmt;
 import org.apache.doris.analysis.AlterJobStatusStmt;
-import org.apache.doris.analysis.AlterRepositoryStmt;
 import org.apache.doris.analysis.AlterRoleStmt;
 import org.apache.doris.analysis.AlterSqlBlockRuleStmt;
 import org.apache.doris.analysis.AlterTableStmt;
@@ -168,10 +167,6 @@ public class DdlExecutor {
             RefreshCatalogStmt refreshCatalogStmt = (RefreshCatalogStmt) 
ddlStmt;
             env.getRefreshManager()
                     .handleRefreshCatalog(refreshCatalogStmt.getCatalogName(), 
refreshCatalogStmt.isInvalidCache());
-        } else if (ddlStmt instanceof AlterRepositoryStmt) {
-            AlterRepositoryStmt alterRepositoryStmt = (AlterRepositoryStmt) 
ddlStmt;
-            
env.getBackupHandler().alterRepository(alterRepositoryStmt.getName(), 
alterRepositoryStmt.getProperties(),
-                    false);
         } else if (ddlStmt instanceof CopyStmt) {
             executeCopyStmt(env, (CopyStmt) ddlStmt);
         } else {


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

Reply via email to