apache / apache/datafusion-sqlparser-rs
Make `CreateTable.location` / `AlterTable.location` make more sense
- Lenguaje dominante
- Rust
- Estrellas
- 3.5k
- Forks
- 772
- Merge medio
- 4 d 9 h
- PR fusionados (30 d)
- 17
Descripción
`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?
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con las definiciones de docs.rs para CreateTable.location, CreateTable.hive_formats.location y AlterTable.location; después, sigue el comportamiento del parser para las formas CREATE EXTERNAL TABLE, CREATE TABLE y ALTER TABLE LOCATION enumeradas en el issue. Se considera terminado cuando la semántica de location sea coherente o esté documentada con claridad, y exista cobertura de regresión para esos casos.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust, sql
- Área
- compilers, databases
- Tipo de issue
- Refactorización
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 30/100