You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by cg...@apache.org on 2021/11/18 01:37:46 UTC

[drill] branch master updated: DRILL-8026: Update Sqlline to 1.12 (#2379)

This is an automated email from the ASF dual-hosted git repository.

cgivre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new 14d96d1  DRILL-8026: Update Sqlline to 1.12 (#2379)
14d96d1 is described below

commit 14d96d1b6a847f3c07a453f6641993da21a4167c
Author: Volodymyr Vysotskyi <vv...@gmail.com>
AuthorDate: Thu Nov 18 03:37:38 2021 +0200

    DRILL-8026: Update Sqlline to 1.12 (#2379)
---
 .../org/apache/drill/exec/client/DrillSqlLineApplication.java    | 9 +++------
 .../apache/drill/exec/client/DrillSqlLineApplicationTest.java    | 2 +-
 pom.xml                                                          | 2 +-
 3 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillSqlLineApplication.java b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillSqlLineApplication.java
index 45315b0..6cce728 100644
--- a/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillSqlLineApplication.java
+++ b/exec/java-exec/src/main/java/org/apache/drill/exec/client/DrillSqlLineApplication.java
@@ -23,8 +23,6 @@ import org.apache.drill.common.scanner.ClassPathScanner;
 import org.apache.drill.common.util.DrillVersionInfo;
 import org.apache.drill.shaded.guava.com.google.common.annotations.VisibleForTesting;
 import org.jline.reader.impl.completer.StringsCompleter;
-import org.jline.utils.AttributedString;
-import org.jline.utils.AttributedStringBuilder;
 import sqlline.Application;
 import sqlline.CommandHandler;
 import sqlline.ConnectionMetadata;
@@ -179,9 +177,8 @@ public class DrillSqlLineApplication extends Application {
     if (config.hasPath(PROMPT_WITH_SCHEMA) && config.getBoolean(PROMPT_WITH_SCHEMA)) {
       return new PromptHandler(sqlLine) {
         @Override
-        protected AttributedString getDefaultPrompt(int connectionIndex, String url, String defaultPrompt) {
-          AttributedStringBuilder builder = new AttributedStringBuilder();
-          builder.style(resolveStyle("f:y"));
+        protected String getDefaultPrompt(int connectionIndex, String url, String defaultPrompt) {
+          StringBuilder builder = new StringBuilder();
           builder.append("apache drill");
 
           ConnectionMetadata meta = sqlLine.getConnectionMetadata();
@@ -190,7 +187,7 @@ public class DrillSqlLineApplication extends Application {
           if (currentSchema != null) {
             builder.append(" (").append(currentSchema).append(")");
           }
-          return builder.style(resolveStyle("default")).append("> ").toAttributedString();
+          return builder.append("> ").toString();
         }
       };
     }
diff --git a/exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillSqlLineApplicationTest.java b/exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillSqlLineApplicationTest.java
index 2c31a85..bab8bcd 100644
--- a/exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillSqlLineApplicationTest.java
+++ b/exec/java-exec/src/test/java/org/apache/drill/exec/client/DrillSqlLineApplicationTest.java
@@ -63,7 +63,7 @@ public class DrillSqlLineApplicationTest extends BaseTest {
 
   @Test
   public void testDrivers() {
-    Collection<String> drivers = application.initDrivers();
+    Collection<String> drivers = application.allowedDrivers();
     assertEquals(1L, drivers.size());
     assertEquals("org.apache.drill.jdbc.Driver", drivers.iterator().next());
   }
diff --git a/pom.xml b/pom.xml
index b1389ee..221f7b6 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,7 +62,7 @@
     <calcite.version>1.21.0-drill-r5</calcite.version>
     <avatica.version>1.17.0</avatica.version>
     <janino.version>3.0.11</janino.version>
-    <sqlline.version>1.9.0</sqlline.version>
+    <sqlline.version>1.12.0</sqlline.version>
     <jackson.version>2.12.1</jackson.version>
     <zookeeper.version>3.5.7</zookeeper.version>
     <mapr.release.version>6.1.0-mapr</mapr.release.version>