4paradigm / 4paradigm/OpenMLDB
request mode: last join order by check should fail if column is not ts of a index
- Vorherrschende Sprache
- C++
- Sterne
- 1.7k
- Forks
- 331
- Ø Merge
- 12 T. 12 Std.
- Gemergte PRs (30 T.)
- 1
Beschreibung
**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.
Beitragsleitfaden
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- sql
- Bereich
- databases, machine-learning
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100