Repository: hive Updated Branches: refs/heads/branch-1 3734d5b67 -> d1e693bb4
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/d1e693bb Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/d1e693bb Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/d1e693bb Branch: refs/heads/branch-1 Commit: d1e693bb42efc4e72339aae02ad4e6f019551b5b Parents: 3734d5b Author: Sushanth Sowmyan <[email protected]> Authored: Mon May 2 12:11:55 2016 -0700 Committer: Sushanth Sowmyan <[email protected]> Committed: Mon May 2 12:11:55 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/d1e693bb/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) {
