4paradigm / 4paradigm/OpenMLDB

Bug: fail to deal with multiple windows serially when window union tables

オープン
#869 コメント 0 件 リアクション 0 件 担当者 2 名 @jingchen2222 が担当を希望しています GitHub で見る
enhancement
主要言語
C++
スター
1.7k
フォーク
331
平均マージ
12日 12時間
マージ済み PR(30日)
1

説明

Issue tracker is **ONLY** used for reporting bugs. New features should be discussed on our discussion

```yaml
-
id: 26
desc: 两个union,不同的maxsize
mode: cluster-unsupport
inputs:
-
columns : ["id int","c1 string","c3 int","c4 bigint","c5 float","c6 double","c7 timestamp","c8 date"]
indexs: ["index1:c1:c7"]
rows:
- [1,"aa",20,30,1.1,2.1,1590738990000,"2020-05-01"]
- [2,"aa",21,31,1.2,2.2,1590738990001,"2020-05-01"]
- [5,"aa",24,34,1.5,2.5,1590738990004,"2020-05-02"]
-
columns : ["id int","c1 string","c3 int","c4 bigint","c5 float","c6 double","c7 timestamp","c8 date"]
indexs: ["index1:c1:c7"]
rows:
- [3,"aa",22,32,1.3,2.3,1590738990002,"2020-05-01"]
-
columns : ["id int","c1 string","c3 int","c4 bigint","c5 float","c6 double","c7 timestamp","c8 date"]
indexs: ["index1:c1:c7"]
rows:
- [4,"aa",23,33,1.4,2.4,1590738990003,"2020-05-01"]
sql: |
SELECT id, c1, sum(c4) OVER w1 as w1_c4_sum, sum(c4) OVER w2 as w2_c4_sum FROM {0} WINDOW
w1 AS (UNION {1} PARTITION BY {0}.c1 ORDER BY {0}.c7 ROWS_RANGE BETWEEN 5 PRECEDING AND CURRENT ROW MAXSIZE 4),
w2 AS (UNION {1},{2} PARTITION BY {0}.c1 ORDER BY {0}.c7 ROWS_RANGE BETWEEN 5 PRECEDING AND CURRENT ROW MAXSIZE 2);
expect:
order: id
columns: ["id int","c1 string","w1_c4_sum bigint","w2_c4_sum bigint"]
rows:
- [1,"aa",30,30]
- [2,"aa",61,61]
- [5,"aa",127,67]
```
## Expected Behavior

SQL runs successfully under online mode and offline mode.
## Current Behavior

```
W1208 20:42:01.557590 629636544 expr_node.cc:35] ColumnRef should be transformed out before infer pass
W1208 20:42:01.558408 629636544 expr_node.cc:35] ColumnRef should be transformed out before infer pass
I1208 20:42:01.558436 629636544 udf_library.cc:272] Resolve 'sum'to sum(list_int64)
W1208 20:42:01.558599 629636544 expr_node.cc:35] ColumnRef should be transformed out before infer pass
W1208 20:42:01.558789 629636544 physical_op.cc:35] Schemas size aren't consistent: expect size 9, real size 8
W1208 20:42:01.558799 629636544 physical_op.h:1139] Union Table and window input schema aren't consistent
I1208 20:42:01.559028 629636544 engine_test_base.cc:398] SQL Compile take 4.463 milliseconds
I1208 20:42:01.559046 629636544 engine_test_base.cc:401] Fail to add window union table
(At /Users/chenjing/work/chenjing/OpenMLDB/hybridse/src/vm/sql_compiler.cc:261)
(At /Users/chenjing/work/chenjing/OpenMLDB/hybridse/src/vm/sql_compiler.cc:166)
(Caused by) Fail to generate physical plan batch mode
(At /Users/chenjing/work/chenjing/OpenMLDB/hybridse/src/vm/transform.cc:1711)
(Caused by) Fail to transform query statement
(At /Users/chenjing/work/chenjing/OpenMLDB/hybridse/src/vm/transform.cc:103)
(At /Users/chenjing/work/chenjing/OpenMLDB/hybridse/src/vm/transform.cc:1226)
(Caused by) Fail to add window union table

```
## Possible Solution

## Steps to Reproduce

1.
2.
3.
4.

## Context (Environment)

## Detailed Description

## Possible Implementation

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

The error occurs in sql_compiler.cc and transform.cc when adding a window union table with multiple windows and different MAXSIZE values. Examine the schema consistency checks in physical_op.cc and physical_op.h. Start by running the provided YAML test case to reproduce the 'Schemas size aren't consistent' error, then trace through the window union table handling in the SQL compiler.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
sql
領域
databases, machine-learning
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。