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 29239b6f6b8 [Chore](nereids) Remove CancelJobTaskStmt (#53347)
29239b6f6b8 is described below

commit 29239b6f6b8cdd9b82758081ba5e92e02454f892
Author: csding <[email protected]>
AuthorDate: Thu Jul 17 11:27:42 2025 +0800

    [Chore](nereids) Remove CancelJobTaskStmt (#53347)
---
 fe/fe-core/src/main/cup/sql_parser.cup             |  6 --
 .../apache/doris/analysis/CancelJobTaskStmt.java   | 77 ----------------------
 .../main/java/org/apache/doris/qe/DdlExecutor.java |  8 ---
 3 files changed, 91 deletions(-)

diff --git a/fe/fe-core/src/main/cup/sql_parser.cup 
b/fe/fe-core/src/main/cup/sql_parser.cup
index 933faaea226..4a9ff96a5e2 100644
--- a/fe/fe-core/src/main/cup/sql_parser.cup
+++ b/fe/fe-core/src/main/cup/sql_parser.cup
@@ -2502,12 +2502,6 @@ resume_job_stmt ::=
     {:
         RESULT = new 
AlterJobStatusStmt(parser.where,org.apache.doris.job.common.JobStatus.RUNNING);
     :}
-    ;    
-cancel_job_task_stmt ::=
-   KW_CANCEL KW_TASK opt_wild_where
-    {:
-      RESULT = new CancelJobTaskStmt(parser.where);
-    :}
     ;                          
 // Routine load statement
 create_routine_load_stmt ::=
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelJobTaskStmt.java 
b/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelJobTaskStmt.java
deleted file mode 100644
index 80bcc9a3fe4..00000000000
--- a/fe/fe-core/src/main/java/org/apache/doris/analysis/CancelJobTaskStmt.java
+++ /dev/null
@@ -1,77 +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.
-// This file is copied from
-// 
https://github.com/apache/impala/blob/branch-2.9.0/fe/src/main/java/org/apache/impala/StringLiteral.java
-// and modified by Doris
-
-package org.apache.doris.analysis;
-
-import org.apache.doris.common.AnalysisException;
-import org.apache.doris.common.UserException;
-
-import lombok.Getter;
-
-public class CancelJobTaskStmt extends DdlStmt implements NotFallbackInParser {
-
-    @Getter
-    private String jobName;
-
-    @Getter
-    private Long taskId;
-
-    private Expr expr;
-
-    private static final String jobNameKey = "jobName";
-
-    private static final String taskIdKey = "taskId";
-
-    public CancelJobTaskStmt(Expr whereExpr) {
-        this.expr = whereExpr;
-    }
-
-    @Override
-    public void analyze(Analyzer analyzer) throws UserException {
-        super.analyze(analyzer);
-        CreateJobStmt.checkAuth();
-        CompoundPredicate compoundPredicate = (CompoundPredicate) expr;
-        if (!compoundPredicate.getOp().equals(CompoundPredicate.Operator.AND)) 
{
-            throw new AnalysisException("Only allow compound predicate with 
operator AND");
-        }
-        String jobNameInput = ((SlotRef) 
compoundPredicate.getChildren().get(0).getChild(0)).getColumnName();
-        if (!jobNameKey.equalsIgnoreCase(jobNameInput)) {
-            throw new AnalysisException("Current not support " + jobNameInput);
-        }
-
-        if (!(compoundPredicate.getChildren().get(0).getChild(1) instanceof 
StringLiteral)) {
-            throw new AnalysisException("JobName value must is string");
-        }
-        this.jobName = 
compoundPredicate.getChildren().get(0).getChild(1).getStringValue();
-        String taskIdInput = ((SlotRef) 
compoundPredicate.getChildren().get(1).getChild(0)).getColumnName();
-        if (!taskIdKey.equalsIgnoreCase(taskIdInput)) {
-            throw new AnalysisException("Current not support " + taskIdInput);
-        }
-        if (!(compoundPredicate.getChildren().get(1).getChild(1) instanceof 
IntLiteral)) {
-            throw new AnalysisException("task id  value must is large int");
-        }
-        this.taskId = ((IntLiteral) 
compoundPredicate.getChildren().get(1).getChild(1)).getLongValue();
-    }
-
-    @Override
-    public StmtType stmtType() {
-        return StmtType.CANCEL;
-    }
-}
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 e94afeda976..56f09a4a3cc 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
@@ -30,7 +30,6 @@ import org.apache.doris.analysis.AlterWorkloadGroupStmt;
 import org.apache.doris.analysis.AlterWorkloadSchedPolicyStmt;
 import org.apache.doris.analysis.BackupStmt;
 import org.apache.doris.analysis.CancelExportStmt;
-import org.apache.doris.analysis.CancelJobTaskStmt;
 import org.apache.doris.analysis.CancelLoadStmt;
 import org.apache.doris.analysis.CleanLabelStmt;
 import org.apache.doris.analysis.CleanProfileStmt;
@@ -159,13 +158,6 @@ public class DdlExecutor {
             } catch (Exception e) {
                 throw new DdlException(e.getMessage());
             }
-        } else if (ddlStmt instanceof CancelJobTaskStmt) {
-            CancelJobTaskStmt stmt = (CancelJobTaskStmt) ddlStmt;
-            try {
-                env.getJobManager().cancelTaskById(stmt.getJobName(), 
stmt.getTaskId());
-            } catch (Exception e) {
-                throw new DdlException(e.getMessage());
-            }
         } else if (ddlStmt instanceof DropUserStmt) {
             DropUserStmt stmt = (DropUserStmt) ddlStmt;
             env.getAuth().dropUser(stmt);


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

Reply via email to