apache / apache/datafusion

datafusion-cli: implement syntax highlighting for keywords/literals

Open
#8,701 4 comments 2 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?

Currently datafusion-cli has no colour. Adding syntax highlighting can improve usability/readability

### Describe the solution you'd like

Highlight SQL keywords and literals in different colours, at the minimum

### Describe alternatives you've considered

_No response_

### Additional context

Example of duckdb cli:

![image](https://github.com/apache/arrow-datafusion/assets/22608443/10c3c61b-9b46-43dc-a37b-63db6aa96475)

Could be useful: https://docs.rs/rustyline/latest/rustyline/highlight/trait.Highlighter.html

Contributor guide

Open the contributing guide

Research direction

Start in the datafusion-cli implementation and read the rustyline Highlighter documentation linked in the issue. Identify how SQL input is handled, then add distinct highlighting for SQL keywords and literals and verify the CLI displays the colors correctly.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.