You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ct...@apache.org on 2017/02/08 14:58:59 UTC

[1/2] hive git commit: HIVE-15815: Allow to pass some Oozie properties to Spark in HoS (Chaoyu Tang, reviewed by Xuefu Zhang)

Repository: hive
Updated Branches:
  refs/heads/master aa62dadb1 -> 8a06b9e6e


HIVE-15815: Allow to pass some Oozie properties to Spark in HoS (Chaoyu Tang, 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/d63d98f1
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d63d98f1
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d63d98f1

Branch: refs/heads/master
Commit: d63d98f1142c5dd2ec96cc27ad9b0776f399c348
Parents: aa62dad
Author: Chaoyu Tang <ct...@cloudera.com>
Authored: Wed Feb 8 09:43:56 2017 -0500
Committer: Chaoyu Tang <ct...@cloudera.com>
Committed: Wed Feb 8 09:43:56 2017 -0500

----------------------------------------------------------------------
 .../hadoop/hive/ql/exec/spark/HiveSparkClientFactory.java       | 5 +++++
 1 file changed, 5 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/d63d98f1/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveSparkClientFactory.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveSparkClientFactory.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveSparkClientFactory.java
index 1e97cd4..6e9ba7c 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveSparkClientFactory.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/spark/HiveSparkClientFactory.java
@@ -182,6 +182,11 @@ public class HiveSparkClientFactory {
         sparkConf.put("spark.hadoop." + propertyName, value);
         LOG.info(String.format(
           "load HBase configuration (%s -> %s).", propertyName, LogUtils.maskIfPassword(propertyName,value)));
+      } else if (propertyName.startsWith("oozie")) {
+        String value = hiveConf.get(propertyName);
+        sparkConf.put("spark." + propertyName, value);
+        LOG.info(String.format(
+          "Pass Oozie configuration (%s -> %s).", propertyName, LogUtils.maskIfPassword(propertyName,value)));
       }
 
       if (RpcConfiguration.HIVE_SPARK_RSC_CONFIGS.contains(propertyName)) {


[2/2] hive git commit: HIVE-15626: beeline should not exit after canceling the query on ctrl-c (Vihang Karajgaonkar via Chaoyu Tang)

Posted by ct...@apache.org.
HIVE-15626: beeline should not exit after canceling the query on ctrl-c (Vihang Karajgaonkar via Chaoyu Tang)


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

Branch: refs/heads/master
Commit: 8a06b9e6eca81a08ee4631b60bbbee0a557d2624
Parents: d63d98f
Author: Chaoyu Tang <ct...@cloudera.com>
Authored: Wed Feb 8 09:55:21 2017 -0500
Committer: Chaoyu Tang <ct...@cloudera.com>
Committed: Wed Feb 8 09:55:21 2017 -0500

----------------------------------------------------------------------
 beeline/src/java/org/apache/hive/beeline/BeeLine.java  |  3 ++-
 .../org/apache/hive/beeline/BeeLineSignalHandler.java  |  1 -
 .../java/org/apache/hive/beeline/SunSignalHandler.java | 13 +++++++++++--
 beeline/src/main/resources/BeeLine.properties          |  1 +
 4 files changed, 14 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/8a06b9e6/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 65818dd..abeff02 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLine.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLine.java
@@ -123,7 +123,7 @@ import org.apache.hive.jdbc.Utils.JdbcConnectionParams;
 public class BeeLine implements Closeable {
   private static final ResourceBundle resourceBundle =
       ResourceBundle.getBundle(BeeLine.class.getSimpleName());
-  private final BeeLineSignalHandler signalHandler = null;
+  private final BeeLineSignalHandler signalHandler;
   private static final String separator = System.getProperty("line.separator");
   private boolean exit = false;
   private final DatabaseConnections connections = new DatabaseConnections();
@@ -531,6 +531,7 @@ public class BeeLine implements Closeable {
 
   public BeeLine(boolean isBeeLine) {
     this.isBeeLine = isBeeLine;
+    this.signalHandler = new SunSignalHandler(this);
   }
 
   DatabaseConnection getDatabaseConnection() {

http://git-wip-us.apache.org/repos/asf/hive/blob/8a06b9e6/beeline/src/java/org/apache/hive/beeline/BeeLineSignalHandler.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/BeeLineSignalHandler.java b/beeline/src/java/org/apache/hive/beeline/BeeLineSignalHandler.java
index 378f1b0..7555109 100644
--- a/beeline/src/java/org/apache/hive/beeline/BeeLineSignalHandler.java
+++ b/beeline/src/java/org/apache/hive/beeline/BeeLineSignalHandler.java
@@ -25,7 +25,6 @@ package org.apache.hive.beeline;
 
 import java.sql.Statement;
 
-
 /**
  * BeeLineSignalHandler.
  *

http://git-wip-us.apache.org/repos/asf/hive/blob/8a06b9e6/beeline/src/java/org/apache/hive/beeline/SunSignalHandler.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/SunSignalHandler.java b/beeline/src/java/org/apache/hive/beeline/SunSignalHandler.java
index 8d4097e..3fb9397 100644
--- a/beeline/src/java/org/apache/hive/beeline/SunSignalHandler.java
+++ b/beeline/src/java/org/apache/hive/beeline/SunSignalHandler.java
@@ -30,20 +30,29 @@ import sun.misc.SignalHandler;
 
 public class SunSignalHandler implements BeeLineSignalHandler, SignalHandler {
   private Statement stmt = null;
+  private final BeeLine beeLine;
 
-  SunSignalHandler () {
+  SunSignalHandler (BeeLine beeLine) {
+    this.beeLine = beeLine;
     // Interpret Ctrl+C as a request to cancel the currently
     // executing query.
     Signal.handle (new Signal ("INT"), this);
   }
 
+  @Override
   public void setStatement(Statement stmt) {
     this.stmt = stmt;
   }
 
+  @Override
   public void handle (Signal signal) {
     try {
-      if (stmt != null) {
+      // exit the JVM if Ctrl+C is received
+      // and no current statement is executing
+      if(stmt == null || stmt.isClosed()) {
+        System.exit(127);
+      } else {
+        beeLine.info(beeLine.loc("interrupt-ctrl-c"));
         stmt.cancel();
       }
     } catch (SQLException ex) {

http://git-wip-us.apache.org/repos/asf/hive/blob/8a06b9e6/beeline/src/main/resources/BeeLine.properties
----------------------------------------------------------------------
diff --git a/beeline/src/main/resources/BeeLine.properties b/beeline/src/main/resources/BeeLine.properties
index 141f0c6..af86284 100644
--- a/beeline/src/main/resources/BeeLine.properties
+++ b/beeline/src/main/resources/BeeLine.properties
@@ -151,6 +151,7 @@ server URI and if the URI is correct, then ask the administrator to check the se
 hs2-connection-timed-out: Connection timeout when communicating with HS2 server.
 hs2-unknown-connection-problem: Unknown HS2 problem when communicating with Thrift server.
 hs2-unexpected-error: Unexpected HS2 error when communicating with the Thrift server.
+interrupt-ctrl-c: Interrupting... Please be patient this may take some time.
 
 
 cmd-usage: Usage: java org.apache.hive.cli.beeline.BeeLine \n \