apache / apache/datafusion-sqlparser-rs
stop the use of `dialect_of` and referring to specific dialects in parser
- Langage dominant
- Rust
- Étoiles
- 3.5k
- Forks
- 772
- Merge moyen
- 4 j 9 h
- PR mergées (30 j)
- 17
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez par suivre les utilisations de dialect_of par Parser et son comportement avec les dialectes personnalisés. Comparez ces chemins avec le comportement nécessaire pour la syntaxe « from first » de issue #1400 ; le travail est terminé lorsque Parser ne fait plus référence à des dialectes spécifiques et consulte plutôt le dialecte pour prendre ces décisions.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- rust, sql
- Domaine
- compilers, databases
- Type d'issue
- Refactorisation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100