Skip to content

Commit

Permalink
branch-3.0: [Fix](Insert-Job)Resolving Task Status Discrepancies in Q…
Browse files Browse the repository at this point in the history
…uery Execution Records #45342 (#45405)

Cherry-picked from #45342

Co-authored-by: Calvin Kirs <[email protected]>
  • Loading branch information
github-actions[bot] and CalvinKirs authored Dec 16, 2024
1 parent 4e9012f commit 99c0a99
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public TRow getTvfInfo(String jobName) {
trow.addToColumnValue(new TCell().setStringVal(String.valueOf(getJobId())));
trow.addToColumnValue(new TCell().setStringVal(jobName));
trow.addToColumnValue(new TCell().setStringVal(getJobId() + LABEL_SPLITTER + getTaskId()));
trow.addToColumnValue(new TCell().setStringVal(jobInfo.getState().name()));
trow.addToColumnValue(new TCell().setStringVal(getStatus().name()));
trow.addToColumnValue(new TCell().setStringVal(getErrorMsg()));
// create time
trow.addToColumnValue(new TCell().setStringVal(TimeUtils.longToTimeString(getCreateTimeMs())));
Expand Down
4 changes: 2 additions & 2 deletions regression-test/suites/job_p0/test_base_insert_job.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ suite("test_base_insert_job") {

def taskStatus = sql """select status from tasks("type"="insert") where JobName ='${jobName}'"""
for (int i = 0; i < taskStatus.size(); i++) {
assert taskStatus.get(i).get(0) =="CANCELED" || taskStatus.get(i).get(0) =="FINISHED"
assert taskStatus.get(i).get(0) =="CANCELED" || taskStatus.get(i).get(0) =="SUCCESS"
}
sql """
CREATE JOB ${jobMixedName} ON SCHEDULE every 1 second DO insert into ${tableName} (timestamp, type, user_id) values ('2023-03-18','1','12213');
Expand Down Expand Up @@ -168,7 +168,7 @@ suite("test_base_insert_job") {
// table should have one record after job finished
assert datas.size() == 1
// one time job only has one task. when job finished, task status should be FINISHED
assert datas.get(0).get(0) == "FINISHED"
assert datas.get(0).get(0) == "SUCCESS"
// check table data
def dataCount1 = sql """select count(1) from ${tableName} where user_id=1001"""
assert dataCount1.get(0).get(0) == 1
Expand Down

0 comments on commit 99c0a99

Please sign in to comment.