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

dataroaring 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 82233a3df52 [Enhancement](nereids) delete translateToLegacyStmt in 
DropMTMVCommand (#53868)
82233a3df52 is described below

commit 82233a3df529dd6afb5fa66becb5f11c55792eaf
Author: yaoxiao <yx136264...@163.com>
AuthorDate: Sat Jul 26 18:34:13 2025 +0800

    [Enhancement](nereids) delete translateToLegacyStmt in DropMTMVCommand 
(#53868)
---
 .../main/java/org/apache/doris/catalog/Env.java    | 11 ++++++++++
 .../trees/plans/commands/DropMTMVCommand.java      |  6 +++++-
 .../trees/plans/commands/info/DropMTMVInfo.java    | 24 +++++++++++++---------
 3 files changed, 30 insertions(+), 11 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java 
b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
index abddf8c44a0..ebad2162c21 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/catalog/Env.java
@@ -193,6 +193,7 @@ import 
org.apache.doris.nereids.trees.plans.commands.CreateDatabaseCommand;
 import 
org.apache.doris.nereids.trees.plans.commands.CreateMaterializedViewCommand;
 import org.apache.doris.nereids.trees.plans.commands.CreateViewCommand;
 import 
org.apache.doris.nereids.trees.plans.commands.DropCatalogRecycleBinCommand.IdType;
+import org.apache.doris.nereids.trees.plans.commands.DropMTMVCommand;
 import 
org.apache.doris.nereids.trees.plans.commands.DropMaterializedViewCommand;
 import org.apache.doris.nereids.trees.plans.commands.TruncateTableCommand;
 import org.apache.doris.nereids.trees.plans.commands.UninstallPluginCommand;
@@ -200,6 +201,7 @@ import 
org.apache.doris.nereids.trees.plans.commands.info.AlterMTMVPropertyInfo;
 import org.apache.doris.nereids.trees.plans.commands.info.AlterMTMVRefreshInfo;
 import org.apache.doris.nereids.trees.plans.commands.info.AlterViewInfo;
 import org.apache.doris.nereids.trees.plans.commands.info.CreateViewInfo;
+import org.apache.doris.nereids.trees.plans.commands.info.DropMTMVInfo;
 import org.apache.doris.nereids.trees.plans.commands.info.PartitionNamesInfo;
 import org.apache.doris.nereids.trees.plans.commands.info.TableNameInfo;
 import org.apache.doris.persist.AlterMTMV;
@@ -4341,6 +4343,15 @@ public class Env {
     }
 
     // Drop table
+    public void dropTable(DropMTMVCommand command) throws DdlException {
+        if (command == null) {
+            throw new DdlException("DropMTMVCommand is null");
+        }
+        DropMTMVInfo dropMTMVInfo = command.getDropMTMVInfo();
+        dropTable(dropMTMVInfo.getCatalogName(), dropMTMVInfo.getDbName(), 
dropMTMVInfo.getTableName(), false,
+                true, dropMTMVInfo.isIfExists(), true);
+    }
+
     public void dropTable(DropTableStmt stmt) throws DdlException {
         if (stmt == null) {
             throw new DdlException("DropTableStmt is null");
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DropMTMVCommand.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DropMTMVCommand.java
index f5b986a3718..73fcaa2d4bc 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DropMTMVCommand.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/DropMTMVCommand.java
@@ -41,7 +41,7 @@ public class DropMTMVCommand extends Command implements 
ForwardWithSync {
     @Override
     public void run(ConnectContext ctx, StmtExecutor executor) throws 
Exception {
         dropMTMVInfo.analyze(ctx);
-        Env.getCurrentEnv().dropTable(dropMTMVInfo.translateToLegacyStmt());
+        Env.getCurrentEnv().dropTable(this);
     }
 
     @Override
@@ -53,4 +53,8 @@ public class DropMTMVCommand extends Command implements 
ForwardWithSync {
     public StmtType stmtType() {
         return StmtType.DROP;
     }
+
+    public DropMTMVInfo getDropMTMVInfo() {
+        return dropMTMVInfo;
+    }
 }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DropMTMVInfo.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DropMTMVInfo.java
index 47ae57c7e49..438c305636e 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DropMTMVInfo.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/plans/commands/info/DropMTMVInfo.java
@@ -17,8 +17,6 @@
 
 package org.apache.doris.nereids.trees.plans.commands.info;
 
-import org.apache.doris.analysis.DropTableStmt;
-import org.apache.doris.analysis.TableName;
 import org.apache.doris.catalog.Env;
 import org.apache.doris.common.ErrorCode;
 import org.apache.doris.mysql.privilege.PrivPredicate;
@@ -64,13 +62,19 @@ public class DropMTMVInfo {
         return mvName;
     }
 
-    /**
-     * translate to catalog DropTableStmt
-     */
-    public DropTableStmt translateToLegacyStmt() {
-        TableName tableName = mvName.transferToTableName();
-        DropTableStmt dropTableStmt = new DropTableStmt(ifExists, tableName, 
true);
-        dropTableStmt.setMaterializedView(true);
-        return dropTableStmt;
+    public String getCatalogName() {
+        return mvName.getCtl();
+    }
+
+    public String getDbName() {
+        return mvName.getDb();
+    }
+
+    public String getTableName() {
+        return mvName.getTbl();
+    }
+
+    public boolean isIfExists() {
+        return ifExists;
     }
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to