4paradigm / 4paradigm/OpenMLDB

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

Ouverte
#869 0 commentaires 0 réactions 2 personnes assignées Réclamée par @jingchen2222 Voir sur GitHub
enhancement
Langage dominant
C++
Étoiles
1.7k
Forks
331
Merge moyen
12 j 12 h
PR mergées (30 j)
1

Description

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

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
sql
Domaine
databases, machine-learning
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.