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 026805d62e0 [Chore](nereids) remove DropIndexPolicyStmt (#54817)
026805d62e0 is described below

commit 026805d62e09dd814ca8d3bfc992a1d232c01800
Author: yaoxiao <[email protected]>
AuthorDate: Fri Aug 15 10:07:20 2025 +0800

    [Chore](nereids) remove DropIndexPolicyStmt (#54817)
---
 fe/fe-core/src/main/cup/sql_parser.cup             | 12 ----
 .../apache/doris/analysis/DropIndexPolicyStmt.java | 78 ----------------------
 .../apache/doris/indexpolicy/IndexPolicyMgr.java   |  9 ---
 .../main/java/org/apache/doris/qe/DdlExecutor.java |  3 -
 4 files changed, 102 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 945ce7611f4..c82030a7f25 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -2448,18 +2448,6 @@ drop_stmt ::=
     {:
         RESULT = new AlterTableStmt(tableName, Lists.newArrayList(new 
DropIndexClause(indexName, ifExists, tableName, false)));
     :}
-    | KW_DROP KW_INVERTED KW_INDEX KW_ANALYZER opt_if_exists:ifExists 
ident:policyName
-    {:
-        RESULT = new DropIndexPolicyStmt(ifExists, 
IndexPolicyTypeEnum.ANALYZER, policyName);
-    :}
-    | KW_DROP KW_INVERTED KW_INDEX KW_TOKENIZER opt_if_exists:ifExists 
ident:policyName
-    {:
-        RESULT = new DropIndexPolicyStmt(ifExists, 
IndexPolicyTypeEnum.TOKENIZER, policyName);
-    :}
-    | KW_DROP KW_INVERTED KW_INDEX KW_TOKEN_FILTER opt_if_exists:ifExists 
ident:policyName
-    {:
-        RESULT = new DropIndexPolicyStmt(ifExists, 
IndexPolicyTypeEnum.TOKEN_FILTER, policyName);
-    :}
     ;
 
 // Recover statement
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DropIndexPolicyStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/DropIndexPolicyStmt.java
deleted file mode 100644
index 0fbe332d99c..00000000000
--- 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/DropIndexPolicyStmt.java
+++ /dev/null
@@ -1,78 +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.indexpolicy.IndexPolicyTypeEnum;
-import org.apache.doris.mysql.privilege.PrivPredicate;
-import org.apache.doris.qe.ConnectContext;
-
-import lombok.Getter;
-
-/**
- * Drop index policy statement.
- * syntax:
- * DROP INVERTED INDEX ANALYZER [IF EXISTS] policy_name
- * DROP INVERTED INDEX TOKENIZER [IF EXISTS] policy_name
- * DROP INVERTED INDEX TOKEN_FILTER [IF EXISTS] policy_name
- **/
-public class DropIndexPolicyStmt extends DdlStmt implements 
NotFallbackInParser {
-
-    @Getter
-    private final boolean ifExists;
-
-    @Getter
-    private final String name;
-
-    @Getter
-    private final IndexPolicyTypeEnum type;
-
-    public DropIndexPolicyStmt(boolean ifExists, IndexPolicyTypeEnum type, 
String name) {
-        this.ifExists = ifExists;
-        this.type = type;
-        this.name = 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");
-        }
-    }
-
-    @Override
-    public String toSql() {
-        StringBuilder sb = new StringBuilder();
-        sb.append("DROP ").append(type.name()).append(" ");
-        if (ifExists) {
-            sb.append("IF EXISTS ");
-        }
-        sb.append(name);
-        return sb.toString();
-    }
-
-    @Override
-    public StmtType stmtType() {
-        return StmtType.DROP;
-    }
-}
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/indexpolicy/IndexPolicyMgr.java 
b/fe/fe-core/src/main/java/org/apache/doris/indexpolicy/IndexPolicyMgr.java
index 32cc06ca8c5..7d177c1fb50 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/indexpolicy/IndexPolicyMgr.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/indexpolicy/IndexPolicyMgr.java
@@ -17,7 +17,6 @@
 
 package org.apache.doris.indexpolicy;
 
-import org.apache.doris.analysis.DropIndexPolicyStmt;
 import org.apache.doris.analysis.ShowIndexPolicyStmt;
 import org.apache.doris.catalog.Database;
 import org.apache.doris.catalog.Env;
@@ -293,14 +292,6 @@ public class IndexPolicyMgr implements Writable, 
GsonPostProcessable {
         LOG.info("Drop index policy success: {}", indexPolicyName);
     }
 
-    public void dropIndexPolicy(DropIndexPolicyStmt stmt) throws DdlException, 
AnalysisException {
-        boolean isIfExists = stmt.isIfExists();
-        String indexPolicyName = stmt.getName();
-        IndexPolicyTypeEnum type = stmt.getType();
-
-        dropIndexPolicy(isIfExists, indexPolicyName, type);
-    }
-
     private void checkAnalyzerNotUsedByIndex(String analyzerName) throws 
DdlException {
         List<Database> databases = 
Env.getCurrentEnv().getInternalCatalog().getDbs();
         for (Database db : databases) {
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 3d4c1f7e2b8..5dc9af3e57c 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
@@ -25,7 +25,6 @@ import org.apache.doris.analysis.CreateMaterializedViewStmt;
 import org.apache.doris.analysis.CreateRoutineLoadStmt;
 import org.apache.doris.analysis.CreateTableStmt;
 import org.apache.doris.analysis.DdlStmt;
-import org.apache.doris.analysis.DropIndexPolicyStmt;
 import org.apache.doris.analysis.DropUserStmt;
 import org.apache.doris.analysis.RecoverDbStmt;
 import org.apache.doris.analysis.RecoverPartitionStmt;
@@ -88,8 +87,6 @@ public class DdlExecutor {
         } else if (ddlStmt instanceof RefreshDbStmt) {
             RefreshDbStmt refreshDbStmt = (RefreshDbStmt) ddlStmt;
             
env.getRefreshManager().handleRefreshDb(refreshDbStmt.getCatalogName(), 
refreshDbStmt.getDbName());
-        } else if (ddlStmt instanceof DropIndexPolicyStmt) {
-            env.getIndexPolicyMgr().dropIndexPolicy((DropIndexPolicyStmt) 
ddlStmt);
         } else {
             LOG.warn("Unkown statement " + ddlStmt.getClass());
             throw new DdlException("Unknown statement.");


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

Reply via email to