Repository: hive Updated Branches: refs/heads/master f4380f3b5 -> 84e5b9391
HIVE-20412: NPE in HiveMetaHook (Jason Dere, reviewed by Sergey Shelukhin) Project: http://git-wip-us.apache.org/repos/asf/hive/repo Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/84e5b939 Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/84e5b939 Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/84e5b939 Branch: refs/heads/master Commit: 84e5b939190fb18fe0cac232d7e3edf20fc41652 Parents: f4380f3 Author: Jason Dere <jd...@hortonworks.com> Authored: Wed Sep 12 12:29:37 2018 -0700 Committer: Jason Dere <jd...@hortonworks.com> Committed: Wed Sep 12 12:29:37 2018 -0700 ---------------------------------------------------------------------- .../main/java/org/apache/hadoop/hive/metastore/HiveMetaHook.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hive/blob/84e5b939/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaHook.java ---------------------------------------------------------------------- diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaHook.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaHook.java index ad596d1..3a827f7 100644 --- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaHook.java +++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/HiveMetaHook.java @@ -110,7 +110,8 @@ public interface HiveMetaHook { * @param table new table definition */ public default void preAlterTable(Table table, EnvironmentContext context) throws MetaException { - String alterOpType = context == null ? null : context.getProperties().get(ALTER_TABLE_OPERATION_TYPE); + String alterOpType = (context == null || context.getProperties() == null) ? + null : context.getProperties().get(ALTER_TABLE_OPERATION_TYPE); // By default allow only ADDPROPS and DROPPROPS. // alterOpType is null in case of stats update. if (alterOpType != null && !allowedAlterTypes.contains(alterOpType)){