apache / datafusion

Apache DataFusion SQL Query Engine
https://datafusion.apache.org/
Apache License 2.0
6.41k stars 1.21k forks source link

datafusion-cli: implement syntax highlighting for keywords/literals #8701

Open Jefffrey opened 11 months ago

Jefffrey commented 11 months ago

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

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

alamb commented 11 months ago

This would be awesome

alamb commented 10 months ago

FYI https://github.com/apache/arrow-datafusion/pull/8918

alamb commented 10 months ago

BTW the other duckdb feature that would be super cool to add to datafusion-cli is the 'duckdb tables' (aka that are formatted nicely based on terminal size and that allow you to scroll left / right)

SteveLauC commented 9 months ago

Hi, this is a really cool feature!

I see that it has been implemented, but I didn't get it with DataFusion cli 36, do I need to enable it somewhere?

image

Update: I get it, it has been disabled by default in #9013, to enable it, one has to use datafusion-cli --color