apache / apache/datafusion-sqlparser-rs
stop the use of `dialect_of` and referring to specific dialects in parser
- 主要语言
- Rust
- 星标
- 3.5k
- 派生
- 772
- 平均合并
- 4 天 9 小时
- 30 天内合并 PR
- 17
描述
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.
贡献指南
这个仓库没有索引到贡献指南
调研方向
首先追踪 Parser 对 dialect_of 的使用以及其自定义 dialect 行为。将这些路径与 issue #1400 中 “from first” 语法所需的行为进行比较;完成的标准是 Parser 不再引用特定的 dialect,而是针对这些决策查询 dialect。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust, sql
- 领域
- compilers, databases
- Issue 类型
- 重构
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100