apache / apache/datafusion-sqlparser-rs

Make `CreateTable.location` / `AlterTable.location` make more sense

Đang mở
#1,518 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
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ả

`CreateTable.location` has no documentation and is a tricky edge case, not always set even when SQL statement did set location.

https://docs.rs/sqlparser/latest/sqlparser/ast/struct.CreateTable.html#structfield.location

Since this took some time to figure out, here's what I've found for others also pondering its role:

- `CREATE EXTERNAL TABLE .. LOCATION 'foo'` sets `CreateTable.location`
- `CREATE TABLE .. LOCATION 'foo'` sets `CreateTable.hive_formats.location`
- `ALTER TABLE .. LOCATION` sets `AlterTable.location`
- `AlterTable.location` types are about Hive, and is thus a bit confusing for external tables: https://docs.rs/sqlparser/latest/sqlparser/ast/enum.Statement.html#variant.AlterTable.field.location
- alter vs create behaviors thus do not match

Maybe make Hive syntax use the top-level `location` field?

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 với các định nghĩa trên docs.rs cho CreateTable.location, CreateTable.hive_formats.location và AlterTable.location, sau đó theo dõi hành vi của parser đối với các dạng CREATE EXTERNAL TABLE, CREATE TABLE và ALTER TABLE LOCATION được liệt kê trong issue. Công việc được xem là hoàn tất khi ngữ nghĩa của location được làm cho nhất quán hoặc được ghi chép rõ ràng, cùng với coverage hồi quy cho các trường hợp đó.

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

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.