You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2018/10/06 17:24:10 UTC

[GitHub] xueyumusic commented on a change in pull request #6791: [FLINK-8865][sql-client] Add CLI query code completion in SQL Client

xueyumusic commented on a change in pull request #6791: [FLINK-8865][sql-client] Add CLI query code completion in SQL Client
URL: https://github.com/apache/flink/pull/6791#discussion_r223188362
 
 

 ##########
 File path: flink-libraries/flink-sql-client/src/main/java/org/apache/flink/table/client/cli/CliClient.java
 ##########
 @@ -97,10 +97,12 @@ public CliClient(SessionContext context, Executor executor) {
 			.terminal(terminal)
 			.appName(CliStrings.CLI_NAME)
 			.parser(new SqlMultiLineParser())
+			.completer(new SqlCompleter(context, executor))
 			.build();
 		// this option is disabled for now for correct backslash escaping
 		// a "SELECT '\'" query should return a string with a backslash
 		lineReader.option(LineReader.Option.DISABLE_EVENT_EXPANSION, true);
+		lineReader.setVariable("errors", 1);
 
 Review comment:
   This variable is words distance in `typoMatcher` when do complete in LineReader. Default value is 2 which is a little loose when matching words treats the words which have distance < 2 as the same, so set 1 here

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services