4paradigm / OpenMLDB

OpenMLDB is an open-source machine learning database that provides a feature platform computing consistent features for training and inference.
https://openmldb.ai
Apache License 2.0
1.58k stars 316 forks source link

select into and request mode will get multiple incorrect result #3971

Open tobegit3hub opened 1 month ago

tobegit3hub commented 1 month ago

Bug Description

Use the demo docker image.

Execute the following sql will get one correct data.

SELECT c1, c2, sum(c3) OVER w1 AS w1_c3_sum FROM demo_table1 WINDOW w1 AS (PARTITION BY demo_table1.c1 ORDER BY demo_table1.c6 ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) CONFIG (execute_mode = 'request', values = ("aaa", 11, 22, 1.2, 1.3, 1635247427000, "2021-05-20"));

Execute the following sql will get multiple incorrect data.

SELECT c1, c2, sum(c3) OVER w1 AS w1_c3_sum FROM demo_table1 WINDOW w1 AS (PARTITION BY demo_table1.c1 ORDER BY demo_table1.c6 ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) INTO outfile "online.csv" OPTIONS (header = false, mode = 'overwrite') CONFIG (execute_mode = 'request', values = ("aaa", 11, 22, 1.2, 1.3, 1635247427000, "2021-05-20"));
tobegit3hub commented 1 month ago

It seems that SELECT INTO support CONFIG which is different from SELECT.

We can not pass the execute_mode values in SQL without SELECT CONFIG. Therefore, we can not use request mode in SQL when exporting result set.