hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vgumas...@apache.org
Subject hive git commit: HIVE-10061: HiveConf Should not be used as part of the HS2 client side code (Hari Sankar Sivarama Subramaniyan reviewed by Vaibhav Gumashta)
Date Tue, 05 May 2015 01:12:52 GMT
Repository: hive
Updated Branches:
  refs/heads/master fe01db21a -> c42666ed5


HIVE-10061: HiveConf Should not be used as part of the HS2 client side code (Hari Sankar Sivarama
Subramaniyan reviewed by Vaibhav Gumashta)


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

Branch: refs/heads/master
Commit: c42666ed5cfa2f1ff83be443aea21e8be8041b95
Parents: fe01db2
Author: Vaibhav Gumashta <vgumashta@apache.org>
Authored: Mon May 4 18:12:21 2015 -0700
Committer: Vaibhav Gumashta <vgumashta@apache.org>
Committed: Mon May 4 18:12:21 2015 -0700

----------------------------------------------------------------------
 jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java          | 3 +--
 .../hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java | 5 +++++
 .../org/apache/hive/service/cli/session/TestSessionHooks.java   | 3 +--
 3 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/c42666ed/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
----------------------------------------------------------------------
diff --git a/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java b/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
index 2b4be7f..1b2891b 100644
--- a/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
+++ b/jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java
@@ -58,7 +58,6 @@ import org.apache.http.impl.client.CloseableHttpClient;
 import org.apache.http.protocol.HttpContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hive.jdbc.Utils.JdbcConnectionParams;
 import org.apache.hive.service.auth.HiveAuthFactory;
 import org.apache.hive.service.auth.KerberosSaslHelper;
@@ -158,7 +157,7 @@ public class HiveConnection implements java.sql.Connection {
 
     if (isEmbeddedMode) {
       EmbeddedThriftBinaryCLIService embeddedClient = new EmbeddedThriftBinaryCLIService();
-      embeddedClient.init(new HiveConf());
+      embeddedClient.init(null);
       client = embeddedClient;
     } else {
       // extract user/password from JDBC connection properties if its not supplied in the

http://git-wip-us.apache.org/repos/asf/hive/blob/c42666ed/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java
----------------------------------------------------------------------
diff --git a/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java
b/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java
index ac63537..a57fc8f 100644
--- a/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java
+++ b/service/src/java/org/apache/hive/service/cli/thrift/EmbeddedThriftBinaryCLIService.java
@@ -37,6 +37,11 @@ public class EmbeddedThriftBinaryCLIService extends ThriftBinaryCLIService
{
 
   @Override
   public synchronized void init(HiveConf hiveConf) {
+	// Null HiveConf is passed in jdbc driver side code since driver side is supposed to be
+	// independent of hiveConf object. Create new HiveConf object here in this case.
+	if (hiveConf == null) {
+	  hiveConf = new HiveConf();
+	}
     cliService.init(hiveConf);
     cliService.start();
     super.init(hiveConf);

http://git-wip-us.apache.org/repos/asf/hive/blob/c42666ed/service/src/test/org/apache/hive/service/cli/session/TestSessionHooks.java
----------------------------------------------------------------------
diff --git a/service/src/test/org/apache/hive/service/cli/session/TestSessionHooks.java b/service/src/test/org/apache/hive/service/cli/session/TestSessionHooks.java
index 746987d..aaf7388 100644
--- a/service/src/test/org/apache/hive/service/cli/session/TestSessionHooks.java
+++ b/service/src/test/org/apache/hive/service/cli/session/TestSessionHooks.java
@@ -26,7 +26,6 @@ import java.util.concurrent.atomic.AtomicInteger;
 import junit.framework.Assert;
 import junit.framework.TestCase;
 
-import org.apache.hadoop.hive.conf.HiveConf;
 import org.apache.hadoop.hive.conf.HiveConf.ConfVars;
 import org.apache.hive.service.auth.HiveAuthFactory;
 import org.apache.hive.service.cli.HiveSQLException;
@@ -64,7 +63,7 @@ public class TestSessionHooks extends TestCase {
     System.setProperty(ConfVars.HIVE_SERVER2_SESSION_HOOK.varname,
         TestSessionHooks.SessionHookTest.class.getName());
     service = new EmbeddedThriftBinaryCLIService();
-    service.init(new HiveConf());
+    service.init(null);
     client = new ThriftCLIServiceClient(service);
   }
 


Mime
View raw message