4paradigm / 4paradigm/OpenMLDB
lag correctness: wrong result used as parameter of other udaf
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 331
- Avg merge
- 12d 12h
- Merged PRs (30d)
- 1
Description
```yaml
- id: 66
sql: |
select
idx,
sum_where(val, val > lag(val, 1)) over w as out,
from t1
window w as (
partition by gp order by ts
rows_range between 10s preceding and 1s preceding
)
inputs:
- name: t1
columns: ["idx int", "gp int", "val int", "ts timestamp"]
indexs: ['idx:gp:ts']
data: |
100, 1, 1, 1000
200, 1, 2, 2000
300, 1, 1, 3000
400, 1, 2, 4000
expect:
columns:
- idx int
- out int32
order: idx
data: |
100, NULL
200, NULL
300, NULL
400, 2
```
`sum_where` and `lag` compute over the same history window [10s - 1s] , however does not meet the specification for `lag` (**always evaluated based on current row**).
Contributor guide
Assessment
This issue has not been assessed yet.