4paradigm / 4paradigm/OpenMLDB

select into and request mode will get multiple incorrect result

Open
#3,971 1 comment 0 reactions 1 assignee Claimed by @aceforeverd View on GitHub
bug
Dominant language
C++
Stars
1.7k
Forks
331
Avg merge
12d 12h
Merged PRs (30d)
1

Description

**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"));
```

Contributor guide

Open the contributing guide

Research direction

The issue involves a window function query producing incorrect results when combined with SELECT INTO OUTFILE in request mode. Start by examining the query execution path for request mode and the INTO OUTFILE handling in the codebase. Look for differences in result set generation or serialization between the two query forms. Run the provided SQL against the demo docker image to reproduce the issue, then trace through the relevant database engine modules.

Written by the indexing model from the issue text.

Assessment

Tech stack
sql
Domain
databases, machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.