-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Description
The Druid Console Workbench will auto-complete in the wrong contexts and should be smarter.
I propose the following changes:
- "enter" shouldn't trigger an auto-complete
- Numerals should not be candidate for autocompletion
- Inside of double quote "" blocks, function names should not be candidate for autocompletion: datasource and field names only
- Inside of single quote '' blocks, should not be candidate for autocompletion
- Other common / completed phrases such as NULL and "count" should not be candidate for autocompletion
Motivation
Make working with Workbench less annoying.
For example, "1" will auto-complete as "LOG10" on (enter). This is extremely annoying as it's pretty typical to write a query that ends in GROUP BY 1
; only to have auto-complete change it to GROUP BY LOG10
.
Other annoyances include when writing inside of a string block ("" or '') the auto-completer will try to fill in function names. AND subject = 'foo'
will auto-complete to AND subject = 'FLOOR'
Datasource and field names should be within context for double quotes "", but not function names. And I can't think of any reason to auto-complete when inside of single quotes '' (maybe local context)
More examples of auto-complete annoyances:
IS NOT NULL
auto-completes toIS NOT NULLIF
SUM("count")
auto-completes toSUM("COUNT")
Activity
gianm commentedon Apr 1, 2025
I'm not familiar with how the autocomplete is coded, in particular I'm not sure how much control we have over it (vs. it coming in as part of a component we're importing). Perhaps @vogievetsky has a comment on that.
As to the specifics, some 2¢:
1
autocompleting asLOG10
(it doesn't autocomplete at all when I tried it just now on a relatively recent build-- maybe something changed).JRobTS commentedon Apr 28, 2025
I should note I'm using Apache Druid 29.0.0
I agree with autocompleting on tab only
Tested again and even

SELECT 1
recommendsLOG10
vogievetsky commentedon May 24, 2025
Sorry it took me a while to get around to responding to this issue. I somehow missed it. I am planning on upgrading the autocomplete based on the feedback in this issue. Here are my thoughts:
100% agree. This was actually fixed in https://github.com/apache/druid/pull/16586/files#diff-71a7ad6a5ecf4d541e559dcff8be182e9cdbf75f353284272b36e8bf6542e22cR190 so if you upgrade to Druid 31 or later this is done.
Agree. That will be a huge improvement. I am working on his right now as a direct result of this issue.
I think this can be addressed by tweaking the scores of the completions. Like a full match should always be the highest score. Specifically I 100% agree that typing
IS NOT NULL (Enter)
should not autocomplete toIS NOT NULLIF
in this case it would be solved if theNULL
completion was scored higher due to being a perfect match.This one I do not agree with. Enter appears to be a standard autocomplete trigger. Specifically it is a trigger in WebStorm/InteliJ, VSCode, and even in this window where I am typing right now @JRobTS (I just typed your handle by typing
@
,J
,(enter)
). I think you are saying that because of all the other issues in autocomplete. Let's see if we can make autocomplete work so well that you won't even mind having Enter be a trigger. Challenge accepted.