Repository: hive Updated Branches: refs/heads/master 2abea8e16 -> 4b5f0d963
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/4b5f0d96 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/4b5f0d96 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/4b5f0d96 Branch: refs/heads/master Commit: 4b5f0d963e8e759856437eb641d35bd4ce3c38f7 Parents: 2abea8e Author: Sushanth Sowmyan <[email protected]> Authored: Mon May 2 12:09:09 2016 -0700 Committer: Sushanth Sowmyan <[email protected]> Committed: Mon May 2 12:09:09 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/4b5f0d96/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 c4afa0a..a38d904 100644 --- a/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java +++ b/beeline/src/java/org/apache/hive/beeline/DatabaseConnection.java @@ -127,13 +127,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) {
