apache / apache/datafusion-sqlparser-rs
stop the use of `dialect_of` and referring to specific dialects in parser
- Ngôn ngữ chính
- Rust
- Star
- 3.5k
- Fork
- 772
- Merge trung bình
- 4 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 17
Mô tả
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.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách truy vết các cách Parser sử dụng dialect_of và hành vi dialect tùy chỉnh của nó. So sánh các đường đi đó với hành vi cần thiết cho cú pháp “from first” trong issue #1400; hoàn thành nghĩa là Parser không còn tham chiếu đến các dialect cụ thể mà thay vào đó tham vấn dialect cho những quyết định đó.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- rust, sql
- Lĩnh vực
- compilers, databases
- Loại issue
- Tái cấu trúc
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100