apache / apache/datafusion

More intuitive CLI query parsing error reporting

Open
#6,267 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
9.3k
Forks
2.4k
Avg merge
3d 7h
Merged PRs (30d)
344

Description

### Is your feature request related to a problem or challenge?

At the moment `datafusion-cli` utilizes `rustyline` validator to validate the queries, which has a behavior I feel not so intuitive:

The syntax error editing allowing us to have "hints" at the side and go back to edit the line buffer, rather than reporting the parsing error and force re-editing from start, or recover from history which is the way ordinary CLI tools do from my knowledge (e.g. psql or mycli).
This causes some confusions to me at the beginning.

Not sure is it only me feeling like this?

### Describe the solution you'd like

If we keen to keep this editing style perhaps improving the "hints" to encourage going back to edit might be better.

e.g. `🤔 Invalid statement: sql parser error: Expected FROM, found: xxx; You can keep editing this statement or press to give up editing.`

### Describe alternatives you've considered

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in the datafusion-cli rustyline validator path and reproduce the current syntax-error editing flow. Compare it with the psql and mycli behavior mentioned in the issue, then determine whether the hint text or editing behavior is the target. Done means syntax errors provide clear guidance about continuing to edit or pressing Ctrl-C to abandon the statement.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, sql
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.