Repository: hive
Updated Branches:
  refs/heads/branch-1.2 eaab5dbed -> 029b8833e


HIVE-13645 : Beeline needs null-guard around hiveVars and hiveConfVars read 
(Sushanth Sowmyan, reviewed by Thejas Nair)


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

Branch: refs/heads/branch-1.2
Commit: 029b8833e3e954c53457aa9ab5a7b1d9fb1a2258
Parents: eaab5db
Author: Sushanth Sowmyan <[email protected]>
Authored: Mon May 2 12:11:10 2016 -0700
Committer: Sushanth Sowmyan <[email protected]>
Committed: Mon May 2 12:11:10 2016 -0700

----------------------------------------------------------------------
 .../org/apache/hive/beeline/DatabaseConnection.java     | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/029b8833/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
----------------------------------------------------------------------
diff --git a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java 
b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
index 02b2eec..ed4318e 100644
--- a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
+++ b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java
@@ -128,13 +128,17 @@ class DatabaseConnection {
     }
 
     Map<String, String> hiveVars = beeLine.getOpts().getHiveVariables();
-    for (Map.Entry<String, String> var : hiveVars.entrySet()) {
-      info.put(HIVE_VAR_PREFIX + var.getKey(), var.getValue());
+    if (hiveVars != null){
+      for (Map.Entry<String, String> var : hiveVars.entrySet()) {
+        info.put(HIVE_VAR_PREFIX + var.getKey(), var.getValue());
+      }
     }
 
     Map<String, String> hiveConfVars = 
beeLine.getOpts().getHiveConfVariables();
-    for (Map.Entry<String, String> var : hiveConfVars.entrySet()) {
-      info.put(HIVE_CONF_PREFIX + var.getKey(), var.getValue());
+    if (hiveConfVars != null){
+      for (Map.Entry<String, String> var : hiveConfVars.entrySet()) {
+        info.put(HIVE_CONF_PREFIX + var.getKey(), var.getValue());
+      }
     }
 
     if (isDriverRegistered) {

Reply via email to