apache / apache/datafusion-sqlparser-rs

Misleading error message

Open
#796 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
3.5k
Forks
772
Avg merge
4d 9h
Merged PRs (30d)
17

Description

```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")
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by running the SQL reproducer and compare the nested query's parser error with the simpler query's useful error. Trace the parser entry point for the nested SELECT and invalid timestamp comparison; done means the reported location identifies the missing quotes without regressing the simpler diagnostic.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.