hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From x..@apache.org
Subject [26/33] hive git commit: HIVE-11796: CLI option is not updated when executing the initial files[beeline-cli](Ferdinand Xu, reviewed by Xuefu Zhang)
Date Mon, 28 Sep 2015 01:10:46 GMT
HIVE-11796: CLI option is not updated when executing the initial files[beeline-cli](Ferdinand
Xu, reviewed by Xuefu Zhang)


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

Branch: refs/heads/master
Commit: 6e3b173684f44245c15df64940862f00f6075460
Parents: 6380de2
Author: Ferdinand Xu <cheng.a.xu@intel.com>
Authored: Wed Sep 16 22:07:47 2015 -0400
Committer: Ferdinand Xu <cheng.a.xu@intel.com>
Committed: Wed Sep 16 22:07:47 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/hive/beeline/BeeLine.java   | 24 +-------------------
 .../java/org/apache/hive/beeline/Commands.java  |  4 ++++
 2 files changed, 5 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/6e3b1736/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 d8e44de..e96d933 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -694,7 +694,6 @@ public class BeeLine implements Closeable {
     if (!commands.isEmpty()) {
       embeddedConnect();
       connectDBInEmbededMode();
-      updateOptsForCli();
       for (Iterator<String> i = commands.iterator(); i.hasNext(); ) {
         String command = i.next().toString();
         debug(loc("executing-command", command));
@@ -811,7 +810,7 @@ public class BeeLine implements Closeable {
     }
   }
 
-  private void updateOptsForCli() {
+  public void updateOptsForCli() {
     getOpts().updateBeeLineOptsFromConf();
     getOpts().setShowHeader(false);
     getOpts().setOutputFormat("dsv");
@@ -844,9 +843,6 @@ public class BeeLine implements Closeable {
           return code;
         }
         defaultConnect(false);
-        updateOptsForCli();
-
-        processInitFiles(opts.getInitFiles());
       }
 
       if (getOpts().getScriptFile() != null) {
@@ -934,24 +930,6 @@ public class BeeLine implements Closeable {
     }
   }
 
-  /**
-   * Only initial files specified by i option will be executed. The hiverc file will be processed
by session manager.
-   *
-   * @param files
-   * @throws IOException
-   */
-  public void processInitFiles(String[] files) throws IOException {
-    if (files == null || files.length == 0) {
-      return;
-    }
-    for (String initFile : files) {
-      int rc = executeFile(initFile);
-      if (rc != 0) {
-        System.exit(rc);
-      }
-    }
-  }
-
   private int execute(ConsoleReader reader, boolean exitOnError) {
     String line;
     while (!exit) {

http://git-wip-us.apache.org/repos/asf/hive/blob/6e3b1736/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 d16b4ec..44dd18b 100644
--- a/beeline/src/java/org/apache/hive/beeline/Commands.java
+++ b/beeline/src/java/org/apache/hive/beeline/Commands.java
@@ -1389,6 +1389,10 @@ public class Commands {
       beeLine.getDatabaseConnections().setConnection(
           new DatabaseConnection(beeLine, driver, url, props));
       beeLine.getDatabaseConnection().getConnection();
+
+      if (!beeLine.isBeeLine()) {
+        beeLine.updateOptsForCli();
+      }
       beeLine.runInit();
 
       beeLine.setCompletions();


Mime
View raw message