[Chore](Job)It is forbidden to change the status of internal JOB through PAUSE/RESUME (#29036)
This commit is contained in:
@ -58,6 +58,8 @@ public class AlterJobStatusStmt extends DdlStmt {
|
||||
throw new AnalysisException("Value can't is null");
|
||||
}
|
||||
this.jobName = inputValue;
|
||||
|
||||
if (CreateJobStmt.isInnerJob(jobName)) {
|
||||
throw new AnalysisException("Can't alter inner job status");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ public class CreateJobStmt extends DdlStmt {
|
||||
private JobExecuteType executeType;
|
||||
|
||||
// exclude job name prefix, which is used by inner job
|
||||
private final String excludeJobNamePrefix = "inner_";
|
||||
private static final String excludeJobNamePrefix = "inner_";
|
||||
|
||||
private static final ImmutableSet<Class<? extends DdlStmt>> supportStmtSuperClass
|
||||
= new ImmutableSet.Builder<Class<? extends DdlStmt>>().add(InsertStmt.class)
|
||||
@ -208,4 +208,8 @@ public class CreateJobStmt extends DdlStmt {
|
||||
}
|
||||
return executeSql;
|
||||
}
|
||||
|
||||
protected static boolean isInnerJob(String jobName) {
|
||||
return jobName.startsWith(excludeJobNamePrefix);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user