4paradigm / 4paradigm/OpenMLDB
negative `order by` value overflow in window query
- Lingua principale
- C++
- Stelle
- 1.7k
- Fork
- 331
- Merge medio
- 12g 12h
- PR unite (30g)
- 1
Descrizione
**Bug Description**
```yaml
- id: 38
desc: |
window ts < 0 ?
inputs:
- name: t1
columns:
- id int
- ts int64
- g int
- val int
indexs:
- idx:g
data: |
1, -3000, 111, 21
2, -2000, 111, 22
3, -1000, 111, 23
4, 0, 111, 24
5, 1000, 111, 25
sql: |
select
id, ts,
count(val) over w as cnt,
max(val) over w as mv,
min(val) over w as mi
from t1 window w as(
partition by `g` order by `ts`
ROWS_RANGE between 2000 PRECEDING and 0 preceding);
expect:
columns:
- id int
- ts int64
- cnt int64
- mv int
- mi int
order: id
data: |
1, -3000, 1, 21, 21
2, -2000, 2, 22, 21
3, -1000, 3, 23, 21
4, 0, 3, 24, 22
5, 1000, 3, 25, 23
```
decision must make:
- if it is allowed for `int*` column to be the `ts` value of index
- if not, above case will only run in batch mode (`order by` not optimized)
this is a extended case of #2177
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.