Skip to content

HIVE-29664: Add syntax highlight support for beeline#6542

Open
aturoczy wants to merge 2 commits into
apache:masterfrom
aturoczy:HIVE-29664
Open

HIVE-29664: Add syntax highlight support for beeline#6542
aturoczy wants to merge 2 commits into
apache:masterfrom
aturoczy:HIVE-29664

Conversation

@aturoczy

Copy link
Copy Markdown

What changes were proposed in this pull request?

To improve usability, Beeline should support basic Hive SQL syntax highlighting. The implementation can start with a static list of commonly used Hive SQL keywords, such as SELECT, INSERT, JOIN, WHERE, GROUP BY, ORDER BY, CREATE, DROP, ALTER, and others.

image

Why are the changes needed?

To improve the usability for beeline

Does this PR introduce any user-facing change?

yes, the default behavior is to highlight the syntax. It can be turn off, but in my mind it is better if it is on.

How was this patch tested?

Manually, and couple tests add for the parameter management.

@sonarqubecloud

Copy link
Copy Markdown

static final Set<String> CONSTANTS = immutableUpper(
"TRUE", "FALSE", "NULL", "UNKNOWN");

private static final String KEYWORD_LIST =

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, my first though about the PR was a courosity if that way of listing the keywords and types duplicates an existing functionality or not so I consulted with @kasakrisz .

He gave a pointer about the existing parser functionality in HiveParser.
Is it possible to create a solution based on that one?

See:

//this is used to support auto completion in CLI

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Let me check it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants