apache / apache/datafusion-sqlparser-rs

Parse errors should show location of error in input sql string

未關閉
#301 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Rust
星號
3.5k
分支
772
平均合併
4 天 9 小時
30 天內合併 PR
17

描述

When rust compiler finds a problem, it shows me exactly where to look:
```
error[E0308]: mismatched types
--> src/main.rs:73:12
|
72 | fn foo() -> String {
| ------ expected `std::string::String` because of return type
73 | return 42;
| ^^
| |
| expected struct `std::string::String`, found integer
| help: try using a conversion method: `42.to_string()`
```

When `Parser::parse_sql(...)` fails, it does not tell the user what part of the input caused the error:
```
sql parser error: Expected end of statement, found: ENGINE
```

The error should provide a position in the input sql string. Bonus points if it has nice presentation like the rust compiler error messages.

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

從 Parser::parse_sql(...) 進入點開始,追蹤解析失敗是如何建構的,並使用回報的 ENGINE 範例來識別應公開的輸入位置。完成的標準是解析錯誤能指出 SQL 字串中的錯誤位置;採用 Rust 風格的呈現方式是可選的增強。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
rust, sql
領域
compilers
Issue 類型
功能
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。