apache / apache/datafusion-sqlparser-rs

Make `CreateTable.location` / `AlterTable.location` make more sense

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

Descrizione

`CreateTable.location` has no documentation and is a tricky edge case, not always set even when SQL statement did set location.

https://docs.rs/sqlparser/latest/sqlparser/ast/struct.CreateTable.html#structfield.location

Since this took some time to figure out, here's what I've found for others also pondering its role:

- `CREATE EXTERNAL TABLE .. LOCATION 'foo'` sets `CreateTable.location`
- `CREATE TABLE .. LOCATION 'foo'` sets `CreateTable.hive_formats.location`
- `ALTER TABLE .. LOCATION` sets `AlterTable.location`
- `AlterTable.location` types are about Hive, and is thus a bit confusing for external tables: https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Statement.html#variant.AlterTable.field.location
- alter vs create behaviors thus do not match

Maybe make Hive syntax use the top-level `location` field?

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia dalle definizioni in docs.rs di CreateTable.location, CreateTable.hive_formats.location e AlterTable.location, quindi traccia il comportamento del parser per le forme CREATE EXTERNAL TABLE, CREATE TABLE e ALTER TABLE LOCATION elencate nell’issue. Il lavoro è completato quando la semantica di location è resa coerente o documentata chiaramente, con una copertura di regressione per questi casi.

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

Valutazione

Stack tecnologico
rust, sql
Ambito
compilers, databases
Tipo di issue
Refactoring
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.