apache / apache/datafusion-sqlparser-rs

MSSQL parsing errors

Đang mở
#1,709 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ả

1. The `PRINT string | @variable | str_expression` statement in MSSQL doesn't parse as a valid statement, and causes all other statement parsing to fail. I'm processing it now by finding and extracting all of them ahead of time, but it would be nice if they could be handled and ignored--treated essentially the same as comments.

They currently fail with:
`ParserError("Expected: an SQL statement, found: PRINT")`

2. Also, the CONSTRAINT line in this statement fails:
```
CREATE TABLE SAMPLE
(
[ID] numeric(19) NOT NULL ,
CONSTRAINT [ID_PK] PRIMARY KEY CLUSTERED ([ID] ASC)
)
```
With:
`ParserError("Expected: ), found: ASC")`

Also, am happy to contribute PR(s) if you have some general pointers as to where I should start looking :)

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

Start by reproducing the two reported MSSQL cases: PRINT statements currently produce an expected SQL statement error, and the CREATE TABLE constraint produces an expected ')' error at ASC. Trace the parser entry points handling these statements and add regression coverage; done means PRINT no longer prevents other statements from parsing and the clustered primary-key constraint parses successfully.

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
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
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
45/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.