apache / apache/datafusion-sqlparser-rs

Parse errors should show location of error in input sql string

オープン
#301 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Rust
スター
3.5k
フォーク
772
平均マージ
4日 9時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。