Skip to content

Commit

Permalink
1.cancel export, 2 huge-compound case
Browse files Browse the repository at this point in the history
  • Loading branch information
englefly committed Nov 30, 2024
1 parent dfa39da commit 80faacd
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 54 deletions.
7 changes: 4 additions & 3 deletions fe/fe-core/src/main/java/org/apache/doris/load/ExportMgr.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
import org.apache.doris.common.util.TimeUtils;
import org.apache.doris.datasource.InternalCatalog;
import org.apache.doris.mysql.privilege.PrivPredicate;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.expressions.Or;
import org.apache.doris.qe.ConnectContext;
import org.apache.doris.scheduler.exception.JobException;
Expand Down Expand Up @@ -163,7 +164,7 @@ public void cancelExportJob(CancelExportStmt stmt) throws DdlException, Analysis

private List<ExportJob> getWaitingCancelJobs(
String label, String state,
org.apache.doris.nereids.trees.expressions.CompoundPredicate operator)
Expression operator)
throws AnalysisException {
Predicate<ExportJob> jobFilter = buildCancelJobFilter(label, state, operator);
readLock();
Expand All @@ -177,7 +178,7 @@ private List<ExportJob> getWaitingCancelJobs(
@VisibleForTesting
public static Predicate<ExportJob> buildCancelJobFilter(
String label, String state,
org.apache.doris.nereids.trees.expressions.CompoundPredicate operator)
Expression operator)
throws AnalysisException {
PatternMatcher matcher = PatternMatcherWrapper.createMysqlPattern(label,
CaseSensibility.LABEL.getCaseSensibility());
Expand Down Expand Up @@ -207,7 +208,7 @@ public static Predicate<ExportJob> buildCancelJobFilter(
public void cancelExportJob(
String label,
String state,
org.apache.doris.nereids.trees.expressions.CompoundPredicate operator, String dbName)
Expression operator, String dbName)
throws DdlException, AnalysisException {
// List of export jobs waiting to be cancelled
List<ExportJob> matchExportJobs = getWaitingCancelJobs(label, state, operator);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.apache.doris.common.AnalysisException;
import org.apache.doris.common.UserException;
import org.apache.doris.load.ExportJobState;
import org.apache.doris.nereids.trees.expressions.CompoundPredicate;
import org.apache.doris.nereids.trees.expressions.Expression;
import org.apache.doris.nereids.trees.plans.PlanType;
import org.apache.doris.nereids.trees.plans.visitor.PlanVisitor;
Expand Down Expand Up @@ -55,7 +54,7 @@ public CancelExportCommand(String dbName, Expression whereClause) {
@Override
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception {
validate(ctx);
ctx.getEnv().getExportMgr().cancelExportJob(label, state, (CompoundPredicate) whereClause, dbName);
ctx.getEnv().getExportMgr().cancelExportJob(label, state, whereClause, dbName);
}

private void validate(ConnectContext ctx) throws UserException {
Expand Down
Loading

0 comments on commit 80faacd

Please sign in to comment.