4paradigm / 4paradigm/OpenMLDB

When window is open, ts=0, calculation error

Aperta
#2,213 0 commenti 0 reazioni 1 assegnatario Rivendicata da @aceforeverd Vedi su GitHub
bug execute-engine
Lingua principale
C++
Stelle
1.7k
Fork
331
Merge medio
12g 12h
PR unite (30g)
1

Descrizione

**Bug Description**

When window is open, ts=0, calculation error
+ case
```yaml
- id: 1
desc: ts列的值为0
inputs:
- columns: [ "c1 string","c3 int","c4 bigint","c5 float","c6 double","c7 timestamp","c8 date" ]
indexs: [ "index1:c1:c7" ]
rows:
- [ "aa",20,30,1.1,2.1,0,"2020-05-01" ]
- [ "aa",21,31,1.2,2.2,0,"2020-05-02" ]
- [ "aa",22,32,1.3,2.3,1590738992000,"2020-05-03" ]
- [ "aa",23,33,1.4,2.4,1590738993000,"2020-05-04" ]
- [ "bb",24,34,1.5,2.5,1590738994000,"2020-05-05" ]
sql: |
SELECT c1, c3, sum(c4) OVER w1 as w1_c4_sum FROM {0} WINDOW w1 AS (PARTITION BY {0}.c1 ORDER BY {0}.c7 ROWS_RANGE BETWEEN 2s PRECEDING AND 0s OPEN PRECEDING EXCLUDE CURRENT_TIME);
expect:
order: c3
columns: [ "c1 string","c3 int","w1_c4_sum bigint" ]
rows:
- [ "aa",20,null ]
- [ "aa",21,null ]
- [ "aa",22,null ]
- [ "aa",23,32 ]
- [ "bb",24,null ]
```

**Expected Behavior**
![05980f468cc4b1f1242927164e42f33f](https://user-images.githubusercontent.com/18275570/180155193-67c28cb3-b739-4df4-a964-2a2454a8ebef.png)

**Relation Case**
test_current_row.yaml id:13

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue includes a failing YAML test case for a window function with ts=0. Look at the test file 'test_current_row.yaml' id:13 and the related SQL execution logic for window aggregation. The bug likely involves timestamp handling in the window frame calculation when the timestamp is zero. Start by running the provided test case to reproduce the error, then examine the window function implementation in the C++ codebase.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
sql
Ambito
databases, machine-learning
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
40/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.