Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cli auto completion #8529

Merged
merged 3 commits into from
Jul 14, 2021
Merged

Conversation

lucasdlemos
Copy link
Member

@lucasdlemos lucasdlemos commented Jul 12, 2021

Lucas Lemos added 2 commits July 12, 2021 14:50
Allow parsing incomplete statements while in COMPLETE context
The cli autocompletion was inserting a backslash between words and duplicating the last word
This commit  fixes the issue building the commandCompleter as ArgumentCompleters
@hashhar hashhar requested review from electrum and wendigo July 12, 2021 19:02
Copy link
Member

@kokosing kokosing left a comment

Choose a reason for hiding this comment

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

Thanks

.map(value -> value.toLowerCase(ENGLISH))
.collect(toSet()))
.build());
return new AggregateCompleter(buildArgumentCompleter("CREATE", singletonList("TABLE")),
Copy link
Member

Choose a reason for hiding this comment

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

Can we have also SCHEMA? Can we also have other statements too like ALTER TABLE/SCHEMA

Copy link
Member Author

Choose a reason for hiding this comment

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

I initially kept the list of commands as it was before, but sure. I added those you suggested.

@lucasdlemos lucasdlemos requested a review from kokosing July 12, 2021 19:56
@lucasdlemos lucasdlemos force-pushed the lucas/fix-cli-completion branch from d954dd7 to ebf9adf Compare July 12, 2021 19:58
@@ -22,17 +22,17 @@
import java.util.List;

import static java.util.Arrays.asList;
import static java.util.Collections.singletonList;
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep this fixup commit as separate commit as you are adding new functionality. So commit message could be just Add additional commands to cli completion

Copy link
Member Author

@lucasdlemos lucasdlemos Jul 13, 2021

Choose a reason for hiding this comment

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

Sounds good @kokosing. Applied

@lucasdlemos lucasdlemos force-pushed the lucas/fix-cli-completion branch from ebf9adf to 60af3c1 Compare July 13, 2021 12:19
@lucasdlemos lucasdlemos requested a review from kokosing July 13, 2021 12:24
@kokosing kokosing merged commit 05bee54 into trinodb:master Jul 14, 2021
@kokosing kokosing mentioned this pull request Jul 14, 2021
11 tasks
@hashhar hashhar added this to the 360 milestone Jul 14, 2021
@martint
Copy link
Member

martint commented Jul 16, 2021

@cla-bot check

@lcx412
Copy link

lcx412 commented Aug 11, 2021

The exceptions still show in version 360.

@hashhar
Copy link
Member

hashhar commented Aug 11, 2021

@lcx412 make sure you are Trino CLI version >= 360. This was not a change in Trino server and the server version doesn't matter for this bug.

If you can still reproduce with Trino CLI >= 360, please share the stack trace/output so we can debug.

@lcx412
Copy link

lcx412 commented Aug 11, 2021

@hashhar
Sorry, I just upgraded Trino server version to 360 and forgot the CLI version.
All good now. Thanks.

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

Successfully merging this pull request may close these issues.

Trino CLI prints exceptions to stdout when pressing Tab for completion
6 participants