4paradigm / 4paradigm/OpenMLDB

request mode: last join order by check should fail if column is not ts of a index

Aperta
#2,493 1 commento 0 reazioni 1 assegnatario Rivendicata da @aceforeverd Vedi su GitHub
bug execute-engine high-priority
Lingua principale
C++
Stelle
1.7k
Fork
331
Merge medio
12g 12h
PR unite (30g)
1

Descrizione

**Bug Description**

here is the yaml case
```yaml
- id: 1
sql: |
SELECT t1.col1 as id, t1.col0 as t1_col0, t1.col1 + t2.col1 + 1 as test_col1, t1.col2 as t1_col2, str1 FROM t1
last join t2 order by t2.col5 on t1.col1=t2.col1 and t1.col5 = t2.col5;

inputs:
- name: t1
schema: col0:string, col1:int32, col2:int16, col3:float, col4:double, col5:int32, col6:string
index: index2:col2
data: |
0, 1, 5, 1.1, 11.1, 1, 1
0, 2, 5, 2.2, 22.2, 2, 22
1, 3, 55, 3.3, 33.3, 1, 333
1, 4, 55, 4.4, 44.4, 2, 4444
2, 5, 55, 5.5, 55.5, 3, aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
- name: t2
schema: str0:string, str1:string, col3:float, col4:double, col2:int16, col1:int32, col5:int64
index: index1:col1:col5
data: |
2, EEEEE, 5.5, 55.5, 550, 5, 3
1, DDDD, 4.4, 44.4, 550, 4, 2
1, CCC, 3.3, 33.3, 550, 3, 1
0, BB, 2.2, 22.2, 50, 2, 2
0, A, 1.1, 11.1, 50, 1, 1
expect:
schema: id:int32, t1_col0:string, test_col1:int32, t1_col2:int16, str1:string
order: id
data: |
1, 0, 3, 5, A
2, 0, 5, 5, BB
3, 1, 7, 55, CCC
4, 1, 9, 55, DDDD
5, 2, 11, 55, EEEEE
```
`t1.col5` is int32 and not ts of a index, but it compiles ok in request mode

**Expected Behavior**

**Steps to Reproduce**

1.
2.
3.
4.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

The issue is about a SQL join validation bug in request mode. Look at the SQL compiler code handling 'last join order by' clauses, specifically the type checking for the order by column against index timestamps. The test case in the issue body provides a failing YAML example; start by locating where request mode compilation occurs and add a check that t1.col5 must be a timestamp of an index. Run the existing test suite to see the current behavior.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
sql
Ambito
databases, machine-learning
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
45/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.