[fix](case) nereids_p0/update/update_unique_table.groovy (#23195)

fix cases in order to run without load data
This commit is contained in:
Dongyang Li
2023-08-21 11:27:53 +08:00
committed by GitHub
parent b9127fa847
commit 80d83b3a67
8 changed files with 138 additions and 84 deletions

View File

@ -100,4 +100,7 @@ suite("nereids_insert_aggregate") {
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc2 'select * from agg_light_sc_not_null_t order by id, kint'
sql 'alter table agg_light_sc_t rename column ktinyint ktint'
sql 'alter table agg_light_sc_not_null_t rename column ktinyint ktint'
}

View File

@ -101,4 +101,16 @@ suite("nereids_insert_duplicate") {
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc2 'select * from dup_light_sc_not_null_t order by id, kint'
sql 'set delete_without_partition=true'
sql '''delete from dup_t where id is not null'''
sql '''delete from dup_t where id is null'''
sql '''delete from dup_light_sc_t where id is not null'''
sql '''delete from dup_light_sc_t where id is null'''
sql '''delete from dup_not_null_t where id is not null'''
sql '''delete from dup_not_null_t where id is null'''
sql '''delete from dup_light_sc_not_null_t where id is not null'''
sql '''delete from dup_light_sc_not_null_t where id is null'''
sql 'alter table dup_light_sc_t rename column ktinyint ktint'
sql 'alter table dup_light_sc_not_null_t rename column ktinyint ktint'
}

View File

@ -263,4 +263,42 @@ suite('nereids_insert_no_partition') {
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc4 'select * from uni_light_sc_mow_not_null_nop_t order by id, kint'
sql 'set delete_without_partition=true'
sql '''delete from agg_nop_t where id is not null'''
sql '''delete from agg_nop_t where id is null'''
sql '''delete from agg_light_sc_nop_t where id is not null'''
sql '''delete from agg_light_sc_nop_t where id is null'''
sql '''delete from agg_not_null_nop_t where id is not null'''
sql '''delete from agg_not_null_nop_t where id is null'''
sql '''delete from agg_light_sc_not_null_nop_t where id is not null'''
sql '''delete from agg_light_sc_not_null_nop_t where id is null'''
sql '''delete from dup_nop_t where id is not null'''
sql '''delete from dup_nop_t where id is null'''
sql '''delete from dup_light_sc_nop_t where id is not null'''
sql '''delete from dup_light_sc_nop_t where id is null'''
sql '''delete from dup_not_null_nop_t where id is not null'''
sql '''delete from dup_not_null_nop_t where id is null'''
sql '''delete from dup_light_sc_not_null_nop_t where id is not null'''
sql '''delete from dup_light_sc_not_null_nop_t where id is null'''
sql '''delete from uni_nop_t where id is not null'''
sql '''delete from uni_nop_t where id is null'''
sql '''delete from uni_light_sc_nop_t where id is not null'''
sql '''delete from uni_light_sc_nop_t where id is null'''
sql '''delete from uni_mow_nop_t where id is not null'''
sql '''delete from uni_mow_nop_t where id is null'''
sql '''delete from uni_light_sc_mow_nop_t where id is not null'''
sql '''delete from uni_light_sc_mow_nop_t where id is null'''
sql '''delete from uni_mow_not_null_nop_t where id is not null'''
sql '''delete from uni_mow_not_null_nop_t where id is null'''
sql '''delete from uni_light_sc_mow_not_null_nop_t where id is not null'''
sql '''delete from uni_light_sc_mow_not_null_nop_t where id is null'''
sql 'alter table agg_light_sc_nop_t rename column ktinyint ktint'
sql 'alter table agg_light_sc_not_null_nop_t rename column ktinyint ktint'
sql 'alter table dup_light_sc_nop_t rename column ktinyint ktint'
sql 'alter table dup_light_sc_not_null_nop_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_nop_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_mow_nop_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_not_null_nop_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_mow_not_null_nop_t rename column ktinyint ktint'
}

View File

@ -39,4 +39,8 @@ suite('nereids_insert_random') {
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_13 'select * from dup_t_type_cast_rd order by id, kint'
sql 'set delete_without_partition=true'
sql '''delete from dup_t_type_cast_rd where id is not null'''
sql '''delete from dup_t_type_cast_rd where id is null'''
}

View File

@ -87,4 +87,14 @@ suite("nereids_insert_duplicate") {
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_43 'select * from dup_light_sc_not_null_t_type_cast order by id, kint'
sql 'set delete_without_partition=true'
sql '''delete from dup_t_type_cast where id is not null'''
sql '''delete from dup_t_type_cast where id is null'''
sql '''delete from dup_light_sc_t_type_cast where id is not null'''
sql '''delete from dup_light_sc_t_type_cast where id is null'''
sql '''delete from dup_not_null_t_type_cast where id is not null'''
sql '''delete from dup_not_null_t_type_cast where id is null'''
sql '''delete from dup_light_sc_not_null_t_type_cast where id is not null'''
sql '''delete from dup_light_sc_not_null_t_type_cast where id is null'''
}

View File

@ -177,4 +177,10 @@ suite("nereids_insert_unique") {
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc4 'select * from uni_light_sc_mow_not_null_t order by id, kint'
sql 'alter table uni_light_sc_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_mow_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_not_null_t rename column ktinyint ktint'
sql 'alter table uni_light_sc_mow_not_null_t rename column ktinyint ktint'
}

View File

@ -1,84 +0,0 @@
// 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") {
sql 'drop table if exists t1'
sql '''
create table t1 (
id int,
id1 int,
c1 bigint,
c2 string,
c3 double,
c4 date
) unique key (id, id1)
distributed by hash(id, id1)
properties(
'replication_num'='1',
"function_column.sequence_col" = "c4"
);
'''
sql 'drop table if exists t2'
sql '''
create table t2 (
id int,
c1 bigint,
c2 string,
c3 double,
c4 date
) unique key (id)
distributed by hash(id)
properties(
'replication_num'='1'
);
'''
sql 'drop table if exists t3'
sql '''
create table t3 (
id int
) distributed by hash(id)
properties(
'replication_num'='1'
);
'''
sql '''
INSERT INTO t1 VALUES
(1, 10, 1, '1', 1.0, '2000-01-01'),
(2, 20, 2, '2', 2.0, '2000-01-02'),
(3, 30, 3, '3', 3.0, '2000-01-03');
'''
sql '''
INSERT INTO t2 VALUES
(1, 10, '10', 10.0, '2000-01-10'),
(2, 20, '20', 20.0, '2000-01-20'),
(3, 30, '30', 30.0, '2000-01-30'),
(4, 4, '4', 4.0, '2000-01-04'),
(5, 5, '5', 5.0, '2000-01-05');
'''
sql '''
INSERT INTO t3 VALUES
(1),
(4),
(5);
'''
}

View File

@ -16,6 +16,71 @@
// under the License.
suite('update_unique_table') {
sql 'drop table if exists t1'
sql '''
create table t1 (
id int,
id1 int,
c1 bigint,
c2 string,
c3 double,
c4 date
) unique key (id, id1)
distributed by hash(id, id1)
properties(
'replication_num'='1',
"function_column.sequence_col" = "c4"
);
'''
sql 'drop table if exists t2'
sql '''
create table t2 (
id int,
c1 bigint,
c2 string,
c3 double,
c4 date
) unique key (id)
distributed by hash(id)
properties(
'replication_num'='1'
);
'''
sql 'drop table if exists t3'
sql '''
create table t3 (
id int
) distributed by hash(id)
properties(
'replication_num'='1'
);
'''
sql '''
INSERT INTO t1 VALUES
(1, 10, 1, '1', 1.0, '2000-01-01'),
(2, 20, 2, '2', 2.0, '2000-01-02'),
(3, 30, 3, '3', 3.0, '2000-01-03');
'''
sql '''
INSERT INTO t2 VALUES
(1, 10, '10', 10.0, '2000-01-10'),
(2, 20, '20', 20.0, '2000-01-20'),
(3, 30, '30', 30.0, '2000-01-30'),
(4, 4, '4', 4.0, '2000-01-04'),
(5, 5, '5', 5.0, '2000-01-05');
'''
sql '''
INSERT INTO t3 VALUES
(1),
(4),
(5);
'''
sql 'set enable_nereids_planner=true'
sql 'set enable_fallback_to_original_planner=false'
sql 'set enable_nereids_dml=true'