hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sp...@apache.org
Subject hive git commit: HIVE-13783: Display a secondary prompt on beeline for multi-line statements (Vihang Karajgaonkar, reviewed by Reuben Kuhnert and Sergio Pena)
Date Fri, 20 May 2016 18:00:32 GMT
Repository: hive
Updated Branches:
  refs/heads/master 259e8be1d -> fd06601eb


HIVE-13783: Display a secondary prompt on beeline for multi-line statements (Vihang Karajgaonkar,
reviewed by Reuben Kuhnert and Sergio Pena)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/fd06601e
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/fd06601e
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/fd06601e

Branch: refs/heads/master
Commit: fd06601eb81b39e3ca4d5604ec4f2aebc91c5c5b
Parents: 259e8be
Author: Vihang Karajgaonkar <vihangk1@cloudera.com>
Authored: Fri May 20 12:57:41 2016 -0500
Committer: Sergio Pena <sergio.pena@cloudera.com>
Committed: Fri May 20 12:59:58 2016 -0500

----------------------------------------------------------------------
 beeline/src/java/org/apache/hive/beeline/Commands.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/fd06601e/beeline/src/java/org/apache/hive/beeline/Commands.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/Commands.java b/beeline/src/java/org/apache/hive/beeline/Commands.java
index 32c1275..80703ff 100644
--- a/beeline/src/java/org/apache/hive/beeline/Commands.java
+++ b/beeline/src/java/org/apache/hive/beeline/Commands.java
@@ -1033,8 +1033,8 @@ public class Commands {
     while (beeLine.getConsoleReader() != null && !(line.trim().endsWith(";")) &&
beeLine.getOpts()
         .isAllowMultiLineCommand()) {
 
+      StringBuilder prompt = new StringBuilder(beeLine.getPrompt());
       if (!beeLine.getOpts().isSilent()) {
-        StringBuilder prompt = new StringBuilder(beeLine.getPrompt());
         for (int i = 0; i < prompt.length() - 1; i++) {
           if (prompt.charAt(i) != '>') {
             prompt.setCharAt(i, i % 2 == 0 ? '.' : ' ');
@@ -1046,7 +1046,7 @@ public class Commands {
       if (beeLine.getOpts().isSilent() && beeLine.getOpts().getScriptFile() != null)
{
         extra = beeLine.getConsoleReader().readLine(null, jline.console.ConsoleReader.NULL_MASK);
       } else {
-        extra = beeLine.getConsoleReader().readLine(beeLine.getPrompt());
+        extra = beeLine.getConsoleReader().readLine(prompt.toString());
       }
 
       if (extra == null) { //it happens when using -f and the line of cmds does not end with
;


Mime
View raw message