diff --git a/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test b/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test index 9a6f74340b39..b2ffb8822c58 100644 --- a/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test +++ b/tests/sqllogictests/suites/base/09_fuse_engine/09_0036_merge_into_without_distributed_enable.test @@ -612,24 +612,59 @@ create table source_test(a int,b string,delete_flag bool) cluster by(a,b); statement ok insert into source_test values(1,'d',true),(2,'e',true),(3,'f',false),(4,'e',true),(5,'f',false); +############################################################################### +# To avoid flakiness, using different stage names for http and mysql handlers # +# testing of these 2 handlers may be run concurrently, and conflict with each # +# other, leading to flaky tests. # +############################################################################### + +onlyif mysql statement ok drop stage if exists source_parquet; +onlyif mysql statement ok create stage source_parquet file_format = (type = parquet); +onlyif mysql statement ok remove @source_parquet; +onlyif mysql statement ok copy into @source_parquet from (select * from source_test); +onlyif mysql query TTT merge into `target_test` as tt using (select `a`,`b`,`delete_flag` from @source_parquet (pattern => '.*[.]parquet')) as ss on (ss.`a` = tt.`a`) when matched and ss.`delete_flag` = true then delete when matched then update * when not matched and ss.`delete_flag` = false then insert *; ---- 1 1 2 + +onlyif http +statement ok +drop stage if exists source_parquet_http; + +onlyif http +statement ok +create stage source_parquet_http file_format = (type = parquet); + +onlyif http +statement ok +remove @source_parquet_http; + +onlyif http +statement ok +copy into @source_parquet_http from (select * from source_test); + +onlyif http +query TTT +merge into `target_test` as tt using (select `a`,`b`,`delete_flag` from @source_parquet_http (pattern => '.*[.]parquet')) as ss on (ss.`a` = tt.`a`) +when matched and ss.`delete_flag` = true then delete when matched then update * when not matched and ss.`delete_flag` = false then insert *; +---- +1 1 2 + query TT select * from target_test order by a; ----