apache / apache/datafusion-sqlparser-rs
stop the use of `dialect_of` and referring to specific dialects in parser
- Vorherrschende Sprache
- Rust
- Sterne
- 3.5k
- Forks
- 772
- Ø Merge
- 4 T. 9 Std.
- Gemergte PRs (30 T.)
- 17
Beschreibung
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.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Beginne damit, die Verwendungen von dialect_of durch Parser und dessen benutzerdefiniertes Dialektverhalten nachzuverfolgen. Vergleiche diese Pfade mit dem für die Syntax „from first“ in issue #1400 erforderlichen Verhalten; abgeschlossen ist die Aufgabe, wenn Parser nicht mehr auf bestimmte Dialekte verweist, sondern für diese Entscheidungen den Dialekt konsultiert.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- rust, sql
- Bereich
- compilers, databases
- Issue-Typ
- Refactoring
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100