Repository: hive Updated Branches: refs/heads/branch-2.0 2d335ccb8 -> 53aad28c6
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/53aad28c Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/53aad28c Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/53aad28c Branch: refs/heads/branch-2.0 Commit: 53aad28c69b97fc70aa355180dc833c91898bad1 Parents: 2d335cc Author: Sushanth Sowmyan <[email protected]> Authored: Mon May 2 12:09:09 2016 -0700 Committer: Sushanth Sowmyan <[email protected]> Committed: Mon May 2 12:58:34 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/53aad28c/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 791fec6..b6c1811 100644 --- a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java +++ b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java @@ -130,13 +130,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) {
