apache / apache/datafusion-sqlparser-rs

Misleading error message

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

描述

```sql
select
1
from (
select
f(interval '1 hour')
from t
where time > 2023-01-03T00:00:00Z
)
```

which misses the quotes around `2023-01-03T00:00:00Z` gives:

```text
Error during parsing: ParserError("Expected ), found: '1 hour'")
```

but should probably point somewhere at `time > 2023-01-03T00:00:00Z`.

Note that the reproducer requires the outer select query, otherwise we get an actually useful error:

```text
Error during parsing: ParserError("Expected end of statement, found: T00")
```

貢獻指南

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

研究方向

先執行 SQL 重現案例,並比較巢狀查詢的 parser 錯誤與較簡單查詢的實用錯誤。追蹤巢狀 SELECT 和無效 timestamp 比較的 parser 進入點;當回報的位置能識別出缺少的引號,且不會讓較簡單的診斷發生回歸時,即表示完成。

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

評估

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

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

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