Repository: hive Updated Branches: refs/heads/master 8cec20d97 -> 63fdb513f
Revert "HIVE-13589: beeline - support prompt for password with '-u' option(Ke Jia, reviewed by Vihang Karajgaonkar and Ferdinand Xu)" This reverts commit e6b5115868ca42f974e525d2309e747be65f5d80. Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/63fdb513 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/63fdb513 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/63fdb513 Branch: refs/heads/master Commit: 63fdb513f907309b4de4122ea5e37f17da7e0f7b Parents: 8cec20d Author: Ferdinand Xu <cheng.a...@intel.com> Authored: Thu Sep 8 02:50:40 2016 +0800 Committer: Ferdinand Xu <cheng.a...@intel.com> Committed: Thu Sep 8 02:50:40 2016 +0800 ---------------------------------------------------------------------- .../src/java/org/apache/hive/beeline/BeeLine.java | 15 ++++++--------- .../src/java/org/apache/hive/beeline/Commands.java | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/63fdb513/beeline/src/java/org/apache/hive/beeline/BeeLine.java ---------------------------------------------------------------------- diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLine.java b/beeline/src/java/org/apache/hive/beeline/BeeLine.java index 8e65e39..ecd60f6 100644 --- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java +++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java @@ -881,7 +881,6 @@ public class BeeLine implements Closeable { } try { - ConsoleReader reader = getConsoleReader(inputStream); if (isBeeLine) { int code = initArgs(args); if (code != 0) { @@ -906,7 +905,7 @@ public class BeeLine implements Closeable { } catch (Exception e) { // ignore } - + ConsoleReader reader = getConsoleReader(inputStream); return execute(reader, false); } finally { close(); @@ -1080,16 +1079,14 @@ public class BeeLine implements Closeable { Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { - if(consoleReader != null) { History h = consoleReader.getHistory(); if (h instanceof FileHistory) { - try { - ((FileHistory) h).flush(); - } catch (IOException e) { - error(e); - } + try { + ((FileHistory) h).flush(); + } catch (IOException e) { + error(e); + } } - } } })); http://git-wip-us.apache.org/repos/asf/hive/blob/63fdb513/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 2f3ec13..039e354 100644 --- a/beeline/src/java/org/apache/hive/beeline/Commands.java +++ b/beeline/src/java/org/apache/hive/beeline/Commands.java @@ -1511,7 +1511,7 @@ public class Commands { username = beeLine.getConsoleReader().readLine("Enter username for " + url + ": "); } props.setProperty(JdbcConnectionParams.AUTH_USER, username); - if (password == null || password.length() == 0) { + if (password == null) { password = beeLine.getConsoleReader().readLine("Enter password for " + url + ": ", new Character('*')); }