You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ha...@apache.org on 2017/07/07 20:16:22 UTC

hive git commit: HIVE-10495 : Hive index creation code throws NPE if index table is null (Bing Li via Ashutosh Chauhan)

Repository: hive
Updated Branches:
  refs/heads/master 6b87af747 -> 8b0b83fd5


HIVE-10495 : Hive index creation code throws NPE if index table is null (Bing Li via Ashutosh Chauhan)

Signed-off-by: Ashutosh Chauhan <ha...@apache.org>


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

Branch: refs/heads/master
Commit: 8b0b83fd57553b4cb52129ff36c398e18230b649
Parents: 6b87af7
Author: Bing Li <sa...@gmail.com>
Authored: Fri Jul 7 13:15:38 2017 -0700
Committer: Ashutosh Chauhan <ha...@apache.org>
Committed: Fri Jul 7 13:15:38 2017 -0700

----------------------------------------------------------------------
 .../src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/8b0b83fd/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
----------------------------------------------------------------------
diff --git a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
index 9765ec2..58b9044 100644
--- a/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
+++ b/metastore/src/java/org/apache/hadoop/hive/metastore/HiveMetaStore.java
@@ -4706,7 +4706,8 @@ public class HiveMetaStore extends ThriftHiveMetastore {
     @Override
     public Index add_index(final Index newIndex, final Table indexTable)
         throws InvalidObjectException, AlreadyExistsException, MetaException, TException {
-      startFunction("add_index", ": " + newIndex.toString() + " " + indexTable.toString());
+      String tableName = indexTable != null ? indexTable.getTableName() : "";
+      startFunction("add_index", ": " + newIndex.toString() + " " + tableName);
       Index ret = null;
       Exception ex = null;
       try {
@@ -4725,7 +4726,6 @@ public class HiveMetaStore extends ThriftHiveMetastore {
           throw newMetaException(e);
         }
       } finally {
-        String tableName = indexTable != null ? indexTable.getTableName() : null;
         endFunction("add_index", ret != null, ex, tableName);
       }
       return ret;