4paradigm / 4paradigm/OpenMLDB
negative `order by` value overflow in window query
- 主要言語
- C++
- スター
- 1.7k
- フォーク
- 331
- 平均マージ
- 12日 12時間
- マージ済み PR(30日)
- 1
説明
**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
コントリビューションガイド
調査の方向性
The issue involves window queries with negative timestamp ordering in OpenMLDB. Start by examining the index optimization logic for window queries, particularly around the handling of int64 columns as timestamp values. Look at the test case provided and related issue #2177. Determine if int* columns are allowed as ts values in indexes and how overflow is managed. Run the existing test suite to see current behavior.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- sql
- 領域
- databases, machine-learning
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100