forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix](Job)Replaying logs should not modify the original information o…
…f the job (apache#40474) ## Proposed changes ``` JobExecutionConfiguration jobConfig = new JobExecutionConfiguration(); jobConfig.setExecuteType(JobExecuteType.INSTANT); setJobConfig(jobConfig); ``` - Replaying logs should not modify the original information of the job - Use the new optimizer to check whether the executed statement is legal (cherry picked from commit de90051)
- Loading branch information
1 parent
873f70c
commit 4bc5efa
Showing
6 changed files
with
103 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !select1 -- | ||
JOB_ONETIME ONE_TIME AT 2052-03-18 00:00:00 insert into t_test_BASE_inSert_job (timestamp, type, user_id) values ('2023-03-18','1','12213'); | ||
|
||
-- !select2 -- | ||
JOB_RECURRING RECURRING EVERY 1 HOUR STARTS 2052-03-18 00:00:00 insert into t_test_BASE_inSert_job (timestamp, type, user_id) values ('2023-03-18','1','12213'); | ||
|
28 changes: 28 additions & 0 deletions
28
regression-test/suites/job_p0/job_meta/job_query_test.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// 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. | ||
suite('job_query_test', 'p0,restart_fe') { | ||
def oneTimeJobName = "JOB_ONETIME" | ||
def recurringJobName = "JOB_RECURRING" | ||
qt_select1 """ | ||
select name, ExecuteType,RecurringStrategy,ExecuteSql from jobs("type" = "insert") where name = '${oneTimeJobName}' | ||
""" | ||
qt_select2 """ | ||
select name, ExecuteType,RecurringStrategy,ExecuteSql from jobs("type" = "insert") where name = '${recurringJobName}' | ||
""" | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 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. | ||
|
||
suite('load', 'p0,restart_fe') { | ||
def tableName = "t_test_BASE_inSert_job" | ||
def oneTimeJobName = "JOB_ONETIME" | ||
def recurringJobName = "JOB_RECURRING" | ||
sql """drop table if exists `${tableName}` force""" | ||
sql """ | ||
DROP JOB IF EXISTS where jobname = '${oneTimeJobName}' | ||
""" | ||
sql """ | ||
DROP JOB IF EXISTS where jobname = '${recurringJobName}' | ||
""" | ||
sql """ | ||
CREATE TABLE IF NOT EXISTS `${tableName}` | ||
( | ||
`timestamp` DATE NOT NULL COMMENT "['0000-01-01', '9999-12-31']", | ||
`type` TINYINT NOT NULL COMMENT "[-128, 127]", | ||
`user_id` BIGINT COMMENT "[-9223372036854775808, 9223372036854775807]" | ||
) | ||
DUPLICATE KEY(`timestamp`, `type`) | ||
DISTRIBUTED BY HASH(`type`) BUCKETS 1 | ||
PROPERTIES ( | ||
"replication_allocation" = "tag.location.default: 1" | ||
); | ||
""" | ||
sql """ | ||
CREATE JOB ${recurringJobName} ON SCHEDULE every 1 HOUR STARTS '2052-03-18 00:00:00' comment 'test' DO insert into ${tableName} (timestamp, type, user_id) values ('2023-03-18','1','12213'); | ||
""" | ||
|
||
sql """ | ||
CREATE JOB ${oneTimeJobName} ON SCHEDULE AT '2052-03-18 00:00:00' comment 'test' DO insert into ${tableName} (timestamp, type, user_id) values ('2023-03-18','1','12213'); | ||
""" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters