[ 
https://issues.apache.org/jira/browse/DRILL-3853?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16609591#comment-16609591
 ] 

ASF GitHub Bot commented on DRILL-3853:
---------------------------------------

vdiravka commented on a change in pull request #1462: DRILL-3853: Upgrade to 
SqlLine 1.5.0
URL: https://github.com/apache/drill/pull/1462#discussion_r216411017
 
 

 ##########
 File path: 
exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillSqlLineApplication.java
 ##########
 @@ -0,0 +1,108 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.drill.exec.client;
+
+import jline.console.completer.StringsCompleter;
+import org.apache.drill.common.util.DrillVersionInfo;
+import sqlline.Application;
+import sqlline.CommandHandler;
+import sqlline.OutputFormat;
+import sqlline.ReflectiveCommandHandler;
+import sqlline.SqlLine;
+import sqlline.SqlLineOpts;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+import java.util.Random;
+import java.util.stream.Collectors;
+
+public class DrillSqlLineApplication extends Application {
+
+  private static final String INFO_MESSAGE_TEMPLATE = "apache drill %s\n%s";
+
+  private static final List<String> QUOTES = Arrays.asList(
+      "start your sql engine",
+      "this isn't your grandfather's sql",
+      "a little sql for your nosql",
+      "json ain't no thang",
+      "drill baby drill",
+      "just drill it",
+      "say hello to my little drill",
+      "what ever the mind of man can conceive and believe, drill can query",
+      "the only truly happy people are children, the creative minority and 
drill users",
+      "a drill is a terrible thing to waste",
+      "got drill?",
+      "a drill in the hand is better than two in the bush"
+  );
+
+  private static final List<String> COMMANDS_TO_EXCLUDE = Arrays.asList(
+      "describe", "indexes", "primarykeys", "exportedkeys", "manual",
+      "importedkeys", "procedures", "typeinfo", "dropall", "metadata",
+      "nativesql", "dbinfo", "rehash", "batch", "all", "go", "isolation",
+      "autocommit", "commit", "rollback", "scan", "sql", "call",
+      //exclude connect command and then add it back to ensure connection url 
examples are updated
+      "connect"
+  );
+
+  @Override
+  public String getInfoMessage() {
+    return String.format(INFO_MESSAGE_TEMPLATE,
+      DrillVersionInfo.getVersion(),
+      QUOTES.get(new Random().nextInt(QUOTES.size())));
+  }
+
+  @Override
+  public Collection<String> initDrivers() {
+    return Collections.singletonList("org.apache.drill.jdbc.Driver");
+  }
+
+  @Override
+  public Map<String, OutputFormat> getOutputFormats(SqlLine sqlLine) {
+    return sqlLine.getOutputFormats();
+  }
+
+  @Override
+  public Collection<String> getConnectionUrlExamples() {
+    return Arrays.asList("jdbc:drill:", "jdbc:drill:zk=local");
 
 Review comment:
   What about `jdbc:drill:drillbit=localhost` instead of `jdbc:drill:`?

----------------------------------------------------------------
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:
[email protected]


> Get off Sqlline fork
> --------------------
>
>                 Key: DRILL-3853
>                 URL: https://issues.apache.org/jira/browse/DRILL-3853
>             Project: Apache Drill
>          Issue Type: Improvement
>            Reporter: Parth Chandra
>            Assignee: Arina Ielchiieva
>            Priority: Major
>             Fix For: 1.15.0
>
>
> Drill has it's own forked version of sqlline that includes customizations for 
> displaying the drill version, drill QOTD, removing names of unsupported 
> commands and removing JDBC drivers not shipped with Drill.
> To get off the fork, we need to parameterize these features in sqlline and 
> have them driven from a properties file. The changes should be merged back 
> into sqlline and Drill packaging should then provide a properties file to 
> customize the stock sqlline distribution.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to