apache / apache/datafusion-sqlparser-rs

`Hive` dialect does not support `distribute by` or `sort by` in window specs

Aperta
#2,339 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
3.5k
Fork
772
Merge medio
4g 9h
PR unite (30g)
17

Descrizione

In Hive 3.1.x, we found that the following query executes successfully:
```sql
select row_number() over(distribute by id sort by update_time desc) as row_num
from (select 1 as id, current_timestamp as update_time) t
```

Image

Image

However, when generating the AST using **the latest code from the main branch**, the following error occurs:

Image

Reference documentation:

https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/IdentifiersParser.g#L293-L297
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/SelectClauseParser.g#L135-L139
https://github.com/apache/hive/blob/master/parser/src/java/org/apache/hadoop/hive/ql/parse/FromClauseParser.g#L271-L27

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Riproduci la query nel dialetto Hive e traccia come viene analizzata la relativa specifica della finestra. Confronta la grammatica pertinente in IdentifiersParser.g, SelectClauseParser.g e FromClauseParser.g di Hive, quindi aggiungi una copertura di regressione che dimostri che distribute by e sort by sono accettati e che l'AST viene generato correttamente.

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

Valutazione

Stack tecnologico
rust, sql
Ambito
compilers
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Tranquilla
Chiarezza
Abbastanza chiara
Idoneità per principianti
58/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.