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 摘要。