-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[fix](Nereids) fix cancel task jobs failed #44755
base: master
Are you sure you want to change the base?
Conversation
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
@@ -79,14 +80,17 @@ private void validate() throws AnalysisException { | |||
throw new AnalysisException("JobName value must is string"); | |||
} | |||
this.jobName = ((StringLikeLiteral) expr.child(0).child(1)).getStringValue(); | |||
String taskIdInput = ((StringLikeLiteral) expr.child(1).child(0)).getStringValue(); | |||
if (!(expr.child(1).child(0) instanceof UnboundSlot)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if jobName must string, i think we should change syntax to ensure it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe u should use get text from identifier to keep it same as legacy planner
fd28101
to
00c6e5b
Compare
run buildall |
TPC-H: Total hot run time: 39831 ms
|
TPC-DS: Total hot run time: 197890 ms
|
ClickBench: Total hot run time: 33.14 s
|
00c6e5b
to
2816bc2
Compare
run buildall |
TPC-H: Total hot run time: 39869 ms
|
TPC-DS: Total hot run time: 191193 ms
|
ClickBench: Total hot run time: 32.95 s
|
| DROP JOB (IF EXISTS)? wildWhere? #dropJob | ||
| RESUME JOB wildWhere? #resumeJob | ||
| CANCEL TASK wildWhere? #cancelJobTask | ||
| PAUSE JOB WHERE (jobNameKey=STRING_LITERAL) EQ (jobNameValue=STRING_LITERAL) #pauseJob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
jobNameKey is not a string literal. should be identifier
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
run buildall |
TPC-H: Total hot run time: 40235 ms
|
TPC-DS: Total hot run time: 197336 ms
|
ClickBench: Total hot run time: 32.78 s
|
@@ -59,36 +44,9 @@ public <R, C> R accept(PlanVisitor<R, C> visitor, C context) { | |||
|
|||
@Override | |||
public void run(ConnectContext ctx, StmtExecutor executor) throws Exception { | |||
validate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we miss the permission check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, mistoken delete
run buildall |
TPC-H: Total hot run time: 40163 ms
|
TPC-DS: Total hot run time: 191123 ms
|
ClickBench: Total hot run time: 32.34 s
|
run buildall |
TPC-H: Total hot run time: 39688 ms
|
TPC-DS: Total hot run time: 189460 ms
|
ClickBench: Total hot run time: 33.37 s
|
c32dabf
run buildall |
wildWhere = getWildWhere(ctx.wildWhere()); | ||
} | ||
return new PauseJobCommand(wildWhere); | ||
return new PauseJobCommand(stripQuotes(ctx.jobNameValue.getText())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we do not check jobNameKey?
String jobName = stripQuotes(ctx.jobNameValue.getText()); | ||
Long taskId = Long.valueOf(ctx.taskIdValue.getText()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if sql like cancel task where task_id = '123' and job_name = 123
?
TPC-H: Total hot run time: 39707 ms
|
TPC-DS: Total hot run time: 196157 ms
|
ClickBench: Total hot run time: 31.59 s
|
run buildall |
TPC-H: Total hot run time: 40301 ms
|
TPC-DS: Total hot run time: 190024 ms
|
ClickBench: Total hot run time: 31.94 s
|
run buildall |
TPC-H: Total hot run time: 39880 ms
|
TPC-DS: Total hot run time: 196128 ms
|
ClickBench: Total hot run time: 32.4 s
|
run p0 |
@@ -770,41 +770,38 @@ public LogicalPlan visitCreateScheduledJob(DorisParser.CreateScheduledJobContext | |||
return new CreateJobCommand(createJobInfo); | |||
} | |||
|
|||
private void checkJobNameKey(String key, String keyFormat) { | |||
if (key.isEmpty() || !key.equalsIgnoreCase(keyFormat)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why add key.isEmpty()?
@@ -770,41 +770,38 @@ public LogicalPlan visitCreateScheduledJob(DorisParser.CreateScheduledJobContext | |||
return new CreateJobCommand(createJobInfo); | |||
} | |||
|
|||
private void checkJobNameKey(String key, String keyFormat) { | |||
if (key.isEmpty() || !key.equalsIgnoreCase(keyFormat)) { | |||
throw new ParseException(keyFormat + " should be: '" + keyFormat + "'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error message is not very clear, we should use ParseException with Origin, or different statement use different error message to let user could know the error reason easily
checkJobNameKey(stripQuotes(ctx.jobNameKey.getText()), "jobName"); | ||
checkJobNameKey(stripQuotes(ctx.taskIdKey.getText()), "taskId"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think must write jobName before taskId is a good idea. since we use where here, we should support jobName = xxx and taskId = xx
and taskId = xx and jobName = xxx
run buildall |
run buildall |
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #44279
Problem Summary:
when cancel task, it should use "taskId" as unbound slot in and right child's left child, otherwise it would failed
Regression test to be added by @CalvinKirs
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)