databendlabs / databend

𝗗𝗮𝘁𝗮, 𝗔𝗻𝗮𝗹𝘆𝘁𝗶𝗰𝘀 & 𝗔𝗜. Modern alternative to Snowflake. Cost-effective and simple for massive-scale analytics. https://databend.com
https://docs.databend.com
Other
7.71k stars 732 forks source link

flaky ci: 09_0036_merge_into_without_distributed_enable.test:627 #16456

Closed TCeason closed 1 week ago

TCeason commented 1 week ago

Summary

https://github.com/datafuselabs/databend/actions/runs/10861989837/job/30144676188?pr=16453

Test finished, fail fast enabled, 1 out of 6895 records failed to run
0: query failed: Databend sqllogictests error: http query error: code: 1006, Text: no file found
[SQL] 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 *;
Error: SelfError("sqllogictest failed")
at tests/sqllogictests/suites/base/09_fuse_engine/./09_0036_merge_into_without_distributed_enable.test:627
at tests/sqllogictests/suites/base/09_fuse_engine/09_0026_merge_into.test:4
TCeason commented 1 week ago

cc @dantengsky

dosubot[bot] commented 1 week ago

I found a similar open issue related to a "no file found" error when accessing a parquet file in a SQL logic test. The issue is documented here and suggests that the problem might be due to the inability to read parquet files without knowing their length, as the metadata is read from the end of the file [1].

To resolve the "no file found" error in the Databend SQL logic test for the MERGE operation, ensure that the file path used in the test is correctly specified and that the file is properly written to the expected location. In the provided code, the file is written to the path "/tmp/test/merged". Verify that this path is correct and accessible in your test environment.

Here is the relevant part of the code that writes the parquet file:

let data = Bytes::from(buf);
let builder = Memory::default();
let path = "/tmp/test/merged";
let op = Operator::new(builder).unwrap().finish();
let blocking_op = op.blocking();
blocking_op.write(path, data).unwrap();

Ensure that the directory "/tmp/test/" exists and is writable. If the directory does not exist, you may need to create it before running the test. Additionally, check for any errors during the file writing process that might indicate why the file is not being created.

Moreover, based on the provided test script, ensure that the stage and file format are correctly set up and that the parquet file is correctly copied into the stage. Here is the relevant part of the test script:

statement ok
drop stage if exists distributed_source_parquet;

statement ok
create stage distributed_source_parquet file_format = (type = parquet);

statement ok
remove @distributed_source_parquet;

statement ok
copy into @distributed_source_parquet from (select * from distributed_source_test);

Make sure that the distributed_source_parquet stage is created and the parquet file is copied into it correctly. This setup is crucial for the MERGE operation to find and use the parquet file [2][3].

To continue talking to Dosu, mention @dosu.