[fix](regression-test) add sync after insert into table for nereids case (#20516)

This commit is contained in:
mch_ucchi
2023-06-08 17:52:36 +08:00
committed by GitHub
parent 3054574bc1
commit 41d7c535f2
9 changed files with 153 additions and 4 deletions

View File

@ -26,19 +26,23 @@ suite("nereids_insert_aggregate") {
sql '''insert into nereids_insert_into_table_test.agg_t
select * except(kaint) from src'''
sql 'sync'
qt_11 'select * from agg_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_t with label label_agg_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_12 'select * from agg_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_t partition (p1, p2) with label label_agg
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_13 'select * from agg_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_light_sc_t
select * except(kaint) from src'''
sql 'sync'
qt_21 'select * from agg_light_sc_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_light_sc_t with label label_agg_light_sc_cte
@ -48,32 +52,39 @@ suite("nereids_insert_aggregate") {
sql '''insert into nereids_insert_into_table_test.agg_light_sc_t partition (p1, p2) with label label_agg_light_sc
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_23 'select * from agg_light_sc_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_31 'select * from agg_not_null_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_not_null_t with label label_agg_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_32 'select * from agg_not_null_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_not_null_t partition (p1, p2) with label label_agg_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_33 'select * from agg_not_null_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_light_sc_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_41 'select * from agg_light_sc_not_null_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_light_sc_not_null_t with label label_agg_light_sc_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_42 'select * from agg_light_sc_not_null_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_light_sc_not_null_t partition (p1, p2) with label label_agg_light_sc_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_43 'select * from agg_light_sc_not_null_t order by id, kint'
// test light_schema_change
@ -82,9 +93,11 @@ suite("nereids_insert_aggregate") {
sql '''insert into nereids_insert_into_table_test.agg_light_sc_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc1 'select * from agg_light_sc_t order by id, kint'
sql '''insert into nereids_insert_into_table_test.agg_light_sc_not_null_t
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'
}

View File

@ -64,12 +64,15 @@ suite('complex_insert') {
'''
sql 'insert into dup_comp_t (id, kint, ksint) select id, kint, ksint from src'
sql 'sync'
qt_sql_dup 'select * from dup_comp_t order by id, ksint'
sql 'insert into agg_comp_t (id, kint, ksint) select id, kint, ksint from src'
sql 'sync'
qt_sql_agg 'select * from agg_comp_t order by id, ksint'
sql 'insert into uni_comp_t (id, kint, ksint) select id, kint, ksint from src'
sql 'sync'
qt_sql_uni 'select * from uni_comp_t order by id, ksint'
sql 'truncate table dup_comp_t'
@ -80,6 +83,7 @@ suite('complex_insert') {
(select id, min(kbint) minv from src group by id, kbool) t2
where t1.id = t2.id
'''
sql 'sync'
qt_sql_dup 'select * from dup_comp_t order by id, ksint, kint'
sql 'truncate table agg_comp_t'
@ -90,6 +94,7 @@ suite('complex_insert') {
(select id, min(kbint) minv from src group by id, kbool) t2
where t1.id = t2.id
'''
sql 'sync'
qt_sql_agg 'select * from agg_comp_t order by id, ksint, kint'
sql 'truncate table uni_comp_t'
@ -100,6 +105,7 @@ suite('complex_insert') {
(select id, min(kbint) minv from src group by id, kbool) t2
where t1.id = t2.id
'''
sql 'sync'
qt_sql_uni 'select * from uni_comp_t order by id, ksint, kint'
sql 'drop table if exists t1'
@ -169,15 +175,15 @@ suite('complex_insert') {
'''
sql 'insert into t1(id, c1, c2, c3) select id, c1 * 2, c2, c3 from t1'
sql 'sync'
qt_sql_1 'select * from t1, t2, t3 order by t1.id, t1.id1, t2.id, t3.id'
sql 'insert into t2(id, c1, c2, c3) select id, c1, c2 * 2, c3 from t2'
sql 'sync'
qt_sql_2 'select * from t1, t2, t3 order by t1.id, t1.id1, t2.id, t3.id'
sql 'insert into t2(c1, c3) select c1 + 1, c3 + 1 from (select id, c1, c3 from t1 order by id, c1 limit 10) t1, t3'
sql 'sync'
qt_sql_3 'select * from t1, t2, t3 order by t1.id, t1.id1, t2.id, t3.id'
sql 'drop table if exists agg_have_dup_base'
@ -200,7 +206,7 @@ suite('complex_insert') {
'''
sql 'insert into agg_have_dup_base select -4, -4, -4, \'d\''
sql 'sync'
qt_mv 'select * from agg_have_dup_base'
}

View File

@ -26,54 +26,66 @@ suite("nereids_insert_duplicate") {
sql '''insert into dup_t
select * except(kaint) from src'''
sql 'sync'
qt_11 'select * from dup_t order by id, kint'
sql '''insert into dup_t with label label_dup_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_12 'select * from dup_t order by id, kint'
sql '''insert into dup_t partition (p1, p2) with label label_dup
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_13 'select * from dup_t order by id, kint'
sql '''insert into dup_light_sc_t
select * except(kaint) from src'''
sql 'sync'
qt_21 'select * from dup_light_sc_t order by id, kint'
sql '''insert into dup_light_sc_t with label label_dup_light_sc_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_22 'select * from dup_light_sc_t order by id, kint'
sql '''insert into dup_light_sc_t partition (p1, p2) with label label_dup_light_sc
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_23 'select * from dup_light_sc_t order by id, kint'
sql '''insert into dup_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_31 'select * from dup_not_null_t order by id, kint'
sql '''insert into dup_not_null_t with label label_dup_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_32 'select * from dup_not_null_t order by id, kint'
sql '''insert into dup_not_null_t partition (p1, p2) with label label_dup_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_33 'select * from dup_not_null_t order by id, kint'
sql '''insert into dup_light_sc_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_41 'select * from dup_light_sc_not_null_t order by id, kint'
sql '''insert into dup_light_sc_not_null_t with label label_dup_light_sc_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_42 'select * from dup_light_sc_not_null_t order by id, kint'
sql '''insert into dup_light_sc_not_null_t partition (p1, p2) with label label_dup_light_sc_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_43 'select * from dup_light_sc_not_null_t order by id, kint'
// test light_schema_change
@ -82,9 +94,11 @@ suite("nereids_insert_duplicate") {
sql '''insert into dup_light_sc_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc1 'select * from dup_light_sc_t order by id, kint'
sql '''insert into dup_light_sc_not_null_t
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'
}

View File

@ -26,83 +26,101 @@ suite('nereids_insert_no_partition') {
sql '''insert into agg_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_11 'select * from agg_nop_t order by id, kint'
sql '''insert into agg_nop_t with label label_agg_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_12 'select * from agg_nop_t order by id, kint'
sql '''insert into agg_light_sc_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_21 'select * from agg_light_sc_nop_t order by id, kint'
sql '''insert into agg_light_sc_nop_t with label label_agg_light_sc_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_22 'select * from agg_light_sc_nop_t order by id, kint'
sql '''insert into agg_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_31 'select * from agg_not_null_nop_t order by id, kint'
sql '''insert into agg_not_null_nop_t with label label_agg_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_32 'select * from agg_not_null_nop_t order by id, kint'
sql '''insert into agg_light_sc_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_41 'select * from agg_light_sc_not_null_nop_t order by id, kint'
sql '''insert into agg_light_sc_not_null_nop_t with label label_agg_light_sc_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_42 'select * from agg_light_sc_not_null_nop_t order by id, kint'
sql '''insert into dup_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_11 'select * from dup_nop_t order by id, kint'
sql '''insert into dup_nop_t with label label_dup_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_12 'select * from dup_nop_t order by id, kint'
sql '''insert into dup_light_sc_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_21 'select * from dup_light_sc_nop_t order by id, kint'
sql '''insert into dup_light_sc_nop_t with label label_dup_light_sc_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_22 'select * from dup_light_sc_nop_t order by id, kint'
sql '''insert into dup_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_31 'select * from dup_not_null_nop_t order by id, kint'
sql '''insert into dup_not_null_nop_t with label label_dup_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_32 'select * from dup_not_null_nop_t order by id, kint'
sql '''insert into dup_light_sc_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_41 'select * from dup_light_sc_not_null_nop_t order by id, kint'
sql '''insert into dup_light_sc_not_null_nop_t with label label_dup_light_sc_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_42 'select * from dup_light_sc_not_null_nop_t order by id, kint'
sql '''insert into uni_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_11 'select * from uni_nop_t order by id, kint'
sql '''insert into uni_nop_t with label label_uni_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_12 'select * from uni_nop_t order by id, kint'
sql '''insert into uni_light_sc_nop_t
@ -112,60 +130,73 @@ suite('nereids_insert_no_partition') {
sql '''insert into uni_light_sc_nop_t with label label_uni_light_sc_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_22 'select * from uni_light_sc_nop_t order by id, kint'
sql '''insert into uni_mow_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_31 'select * from uni_mow_nop_t order by id, kint'
sql '''insert into uni_mow_nop_t with label label_uni_mow_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_32 'select * from uni_mow_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_41 'select * from uni_light_sc_mow_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_nop_t with label label_uni_light_sc_mow_cte_nop
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_42 'select * from uni_light_sc_mow_nop_t order by id, kint'
sql '''insert into uni_mow_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_51 'select * from uni_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_mow_not_null_nop_t with label label_uni_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_52 'select * from uni_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_61 'select * from uni_light_sc_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_nop_t with label label_uni_light_sc_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_62 'select * from uni_light_sc_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_mow_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_71 'select * from uni_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_mow_not_null_nop_t with label label_uni_mow_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_72 'select * from uni_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_81 'select * from uni_light_sc_mow_not_null_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_nop_t with label label_uni_light_sc_mow_not_null_cte_nop
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_82 'select * from uni_light_sc_mow_not_null_nop_t order by id, kint'
// test light_schema_change
@ -174,10 +205,12 @@ suite('nereids_insert_no_partition') {
sql '''insert into agg_light_sc_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc1 'select * from agg_light_sc_nop_t order by id, kint'
sql '''insert into agg_light_sc_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc2 'select * from agg_light_sc_not_null_nop_t order by id, kint'
// test light_schema_change
@ -186,10 +219,12 @@ suite('nereids_insert_no_partition') {
sql '''insert into dup_light_sc_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc1 'select * from dup_light_sc_nop_t order by id, kint'
sql '''insert into dup_light_sc_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc2 'select * from dup_light_sc_not_null_nop_t order by id, kint'
// test light_schema_change
@ -200,17 +235,21 @@ suite('nereids_insert_no_partition') {
sql '''insert into uni_light_sc_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc1 'select * from uni_light_sc_nop_t order by id, kint'
sql '''insert into uni_light_sc_not_null_nop_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc2 'select * from uni_light_sc_not_null_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_nop_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc3 'select * from uni_light_sc_mow_nop_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_nop_t
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'
}

View File

@ -26,53 +26,65 @@ suite("nereids_insert_aggregate_type_cast") {
sql '''insert into agg_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_11 'select * from agg_t_type_cast order by id, kint'
sql '''insert into agg_t_type_cast with label label_agg_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_12 'select * from agg_t_type_cast order by id, kint'
sql '''insert into agg_t_type_cast partition (p1, p2) with label label_agg_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_13 'select * from agg_t_type_cast order by id, kint'
sql '''insert into agg_light_sc_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_21 'select * from agg_light_sc_t_type_cast order by id, kint'
sql '''insert into agg_light_sc_t_type_cast with label label_agg_light_sc_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_22 'select * from agg_light_sc_t_type_cast order by id, kint'
sql '''insert into agg_light_sc_t_type_cast partition (p1, p2) with label label_agg_light_sc_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_23 'select * from agg_light_sc_t_type_cast order by id, kint'
sql '''insert into agg_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_31 'select * from agg_not_null_t_type_cast order by id, kint'
sql '''insert into agg_not_null_t_type_cast with label label_agg_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_32 'select * from agg_not_null_t_type_cast order by id, kint'
sql '''insert into agg_not_null_t_type_cast partition (p1, p2) with label label_agg_not_null_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_33 'select * from agg_not_null_t_type_cast order by id, kint'
sql '''insert into agg_light_sc_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_41 'select * from agg_light_sc_not_null_t_type_cast order by id, kint'
sql '''insert into agg_light_sc_not_null_t_type_cast with label label_agg_light_sc_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_42 'select * from agg_light_sc_not_null_t_type_cast order by id, kint'
sql '''insert into agg_light_sc_not_null_t_type_cast partition (p1, p2) with label label_agg_light_sc_not_null_type_cast
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 agg_light_sc_not_null_t_type_cast order by id, kint'
}

View File

@ -26,53 +26,65 @@ suite("nereids_insert_duplicate") {
sql '''insert into dup_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_11 'select * from dup_t_type_cast order by id, kint'
sql '''insert into dup_t_type_cast with label label_dup_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_12 'select * from dup_t_type_cast order by id, kint'
sql '''insert into dup_t_type_cast partition (p1, p2) with label label_dup_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_13 'select * from dup_t_type_cast order by id, kint'
sql '''insert into dup_light_sc_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_21 'select * from dup_light_sc_t_type_cast order by id, kint'
sql '''insert into dup_light_sc_t_type_cast with label label_dup_light_sc_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_22 'select * from dup_light_sc_t_type_cast order by id, kint'
sql '''insert into dup_light_sc_t_type_cast partition (p1, p2) with label label_dup_light_sc_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_23 'select * from dup_light_sc_t_type_cast order by id, kint'
sql '''insert into dup_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_31 'select * from dup_not_null_t_type_cast order by id, kint'
sql '''insert into dup_not_null_t_type_cast with label label_dup_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_32 'select * from dup_not_null_t_type_cast order by id, kint'
sql '''insert into dup_not_null_t_type_cast partition (p1, p2) with label label_dup_not_null_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_33 'select * from dup_not_null_t_type_cast order by id, kint'
sql '''insert into dup_light_sc_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_41 'select * from dup_light_sc_not_null_t_type_cast order by id, kint'
sql '''insert into dup_light_sc_not_null_t_type_cast with label label_dup_light_sc_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_42 'select * from dup_light_sc_not_null_t_type_cast order by id, kint'
sql '''insert into dup_light_sc_not_null_t_type_cast partition (p1, p2) with label label_dup_light_sc_not_null_type_cast
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'
}

View File

@ -26,105 +26,129 @@ suite("nereids_insert_unique_type_cast") {
sql '''insert into uni_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_11 'select * from uni_t_type_cast order by id, kint'
sql '''insert into uni_t_type_cast with label label_uni_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_12 'select * from uni_t_type_cast order by id, kint'
sql '''insert into uni_t_type_cast partition (p1, p2) with label label_uni_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_13 'select * from uni_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_21 'select * from uni_light_sc_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_t_type_cast with label label_uni_light_sc_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_22 'select * from uni_light_sc_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_t_type_cast partition (p1, p2) with label label_uni_light_sc_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_23 'select * from uni_light_sc_t_type_cast order by id, kint'
sql '''insert into uni_mow_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_31 'select * from uni_mow_t_type_cast order by id, kint'
sql '''insert into uni_mow_t_type_cast with label label_uni_mow_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_32 'select * from uni_mow_t_type_cast order by id, kint'
sql '''insert into uni_mow_t_type_cast partition (p1, p2) with label label_uni_mow_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_33 'select * from uni_mow_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src'''
sql 'sync'
qt_41 'select * from uni_light_sc_mow_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_t_type_cast with label label_uni_light_sc_mow_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte'''
sql 'sync'
qt_42 'select * from uni_light_sc_mow_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_t_type_cast partition (p1, p2) with label label_uni_light_sc_mow_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4'''
sql 'sync'
qt_43 'select * from uni_light_sc_mow_t_type_cast order by id, kint'
sql '''insert into uni_mow_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_51 'select * from uni_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_mow_not_null_t_type_cast with label label_uni_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_52 'select * from uni_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_mow_not_null_t_type_cast partition (p1, p2) with label label_uni_not_null_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_53 'select * from uni_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_61 'select * from uni_light_sc_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t_type_cast with label label_uni_light_sc_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_62 'select * from uni_light_sc_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t_type_cast partition (p1, p2) with label label_uni_light_sc_not_null_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_63 'select * from uni_light_sc_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_mow_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_71 'select * from uni_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_mow_not_null_t_type_cast with label label_uni_mow_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_72 'select * from uni_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_mow_not_null_t_type_cast partition (p1, p2) with label label_uni_mow_not_null_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_73 'select * from uni_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id is not null'''
sql 'sync'
qt_81 'select * from uni_light_sc_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t_type_cast with label label_uni_light_sc_mow_not_null_type_cast_cte
with cte as (select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src)
select * from cte where id is not null'''
sql 'sync'
qt_82 'select * from uni_light_sc_mow_not_null_t_type_cast order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t_type_cast partition (p1, p2) with label label_uni_light_sc_mow_not_null_type_cast
select id, ktint, ksint, kint, kbint, kdtv2, kdtm, kdbl from src where id < 4 and id is not null'''
sql 'sync'
qt_83 'select * from uni_light_sc_mow_not_null_t_type_cast order by id, kint'
}

View File

@ -26,106 +26,130 @@ suite("nereids_insert_unique") {
sql '''insert into uni_t
select * except(kaint) from src'''
sql 'sync'
qt_11 'select * from uni_t order by id, kint'
sql '''insert into uni_t with label label_uni_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_12 'select * from uni_t order by id, kint'
sql '''insert into uni_t partition (p1, p2) with label label_uni
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_13 'select * from uni_t order by id, kint'
sql '''insert into uni_light_sc_t
select * except(kaint) from src'''
sql 'sync'
qt_21 'select * from uni_light_sc_t order by id, kint'
sql '''insert into uni_light_sc_t with label label_uni_light_sc_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_22 'select * from uni_light_sc_t order by id, kint'
sql '''insert into uni_light_sc_t partition (p1, p2) with label label_uni_light_sc
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_23 'select * from uni_light_sc_t order by id, kint'
sql '''insert into uni_mow_t
select * except(kaint) from src'''
sql 'sync'
qt_31 'select * from uni_mow_t order by id, kint'
sql '''insert into uni_mow_t with label label_uni_mow_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_32 'select * from uni_mow_t order by id, kint'
sql '''insert into uni_mow_t partition (p1, p2) with label label_uni_mow
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_33 'select * from uni_mow_t order by id, kint'
sql '''insert into uni_light_sc_mow_t
select * except(kaint) from src'''
sql 'sync'
qt_41 'select * from uni_light_sc_mow_t order by id, kint'
sql '''insert into uni_light_sc_mow_t with label label_uni_light_sc_mow_cte
with cte as (select * except(kaint) from src)
select * from cte'''
sql 'sync'
qt_42 'select * from uni_light_sc_mow_t order by id, kint'
sql '''insert into uni_light_sc_mow_t partition (p1, p2) with label label_uni_light_sc_mow
select * except(kaint) from src where id < 4'''
sql 'sync'
qt_43 'select * from uni_light_sc_mow_t order by id, kint'
sql '''insert into uni_mow_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_51 'select * from uni_mow_not_null_t order by id, kint'
sql '''insert into uni_mow_not_null_t with label label_uni_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_52 'select * from uni_mow_not_null_t order by id, kint'
sql '''insert into uni_mow_not_null_t partition (p1, p2) with label label_uni_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_53 'select * from uni_mow_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_61 'select * from uni_light_sc_mow_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t with label label_uni_light_sc_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_62 'select * from uni_light_sc_mow_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t partition (p1, p2) with label label_uni_light_sc_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_63 'select * from uni_light_sc_mow_not_null_t order by id, kint'
sql '''insert into uni_mow_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_71 'select * from uni_mow_not_null_t order by id, kint'
sql '''insert into uni_mow_not_null_t with label label_uni_mow_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_72 'select * from uni_mow_not_null_t order by id, kint'
sql '''insert into uni_mow_not_null_t partition (p1, p2) with label label_uni_mow_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_73 'select * from uni_mow_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_81 'select * from uni_light_sc_mow_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t with label label_uni_light_sc_mow_not_null_cte
with cte as (select * except(kaint) from src)
select * from cte where id is not null'''
sql 'sync'
qt_82 'select * from uni_light_sc_mow_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t partition (p1, p2) with label label_uni_light_sc_mow_not_null
select * except(kaint) from src where id < 4 and id is not null'''
sql 'sync'
qt_83 'select * from uni_light_sc_mow_not_null_t order by id, kint'
// test light_schema_change
@ -136,17 +160,21 @@ suite("nereids_insert_unique") {
sql '''insert into uni_light_sc_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc1 'select * from uni_light_sc_t order by id, kint'
sql '''insert into uni_light_sc_not_null_t
select * except(kaint) from src where id is not null'''
sql 'sync'
qt_lsc2 'select * from uni_light_sc_not_null_t order by id, kint'
sql '''insert into uni_light_sc_mow_t
select * except(kaint) from src'''
sql 'sync'
qt_lsc3 'select * from uni_light_sc_mow_t order by id, kint'
sql '''insert into uni_light_sc_mow_not_null_t
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'
}

View File

@ -31,5 +31,6 @@ suite("nereids_insert_array_type") {
sql 'set enable_fallback_to_original_planner=true'
sql 'insert into arr_t select id, kaint from src'
sql 'sync'
sql 'select * from arr_t'
}