apache / apache/datafusion-sqlparser-rs

stop the use of `dialect_of` and referring to specific dialects in parser

Abierto
#1,430 1 comentario 1 reacción 0 asignados Ver en GitHub
Lenguaje dominante
Rust
Estrellas
3.5k
Forks
772
Merge medio
4 d 9 h
PR fusionados (30 d)
17

Descripción

TL;DR; — I want to stop `Parser` from referring to specific dialects, and instead consult the dialect about specific behaviour.

In particular, use of `dialect_of` and custom dialect behaviour in `Parser` should be removed

Abstract reasons to do this:
* it's very esoteric in Rust, I've never seen another library use this approach, It's like reading (bad) python, in Rust
* it's poor separation of concerns — the Parser should concentrate on parsing SQL, and defer to the dialect about how to behave in some scenarios, rather than holding information about how mysql differs from Snowflake etc.

Concrete reasons to do this:
* I want to use "from first" syntax (#1400) with otherwise postgres syntax — currently dialects can't opt into certain behaviour because the parser is checking for a specific dialect, not for a given behaviour

I've already discussed this with @alamb, I'll try to do this in multiple PRs, to make it easier to review.

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Línea de trabajo

Comienza rastreando los usos que Parser hace de dialect_of y su comportamiento con dialectos personalizados. Compara esas rutas con el comportamiento necesario para la sintaxis “from first” de issue #1400; se considera terminado cuando Parser ya no hace referencia a dialectos específicos, sino que consulta el dialecto para tomar esas decisiones.

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
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.