4paradigm / 4paradigm/OpenMLDB

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

Aperta
#869 0 commenti 0 reazioni 2 assegnatari Rivendicata da @jingchen2222 Vedi su GitHub
enhancement
Lingua principale
C++
Stelle
1.7k
Fork
331
Merge medio
12g 12h
PR unite (30g)
1

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.