hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hashut...@apache.org
Subject hive git commit: HIVE-19172 : NPE due to null EnvironmentContext in DDLTask (Nishant Bangarwa via Ashutosh Chauhan)
Date Fri, 13 Apr 2018 05:40:12 GMT
Repository: hive
Updated Branches:
  refs/heads/master b7c64b15c -> 6a929c58f


HIVE-19172 : NPE due to null EnvironmentContext in DDLTask (Nishant Bangarwa via Ashutosh
Chauhan)

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


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

Branch: refs/heads/master
Commit: 6a929c58f943c41685f6e06a519381e696ad91ad
Parents: b7c64b1
Author: Nishant Bangarwa <nishant.monu51@gmail.com>
Authored: Thu Apr 12 22:39:37 2018 -0700
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Thu Apr 12 22:39:37 2018 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/6a929c58/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
index 61a0432..b9b1830 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/DDLTask.java
@@ -3827,6 +3827,9 @@ public class DDLTask extends Task<DDLWork> implements Serializable
{
 
     try {
       EnvironmentContext environmentContext = alterTbl.getEnvironmentContext();
+      if (environmentContext == null) {
+        environmentContext = new EnvironmentContext();
+      }
       environmentContext.putToProperties(HiveMetaHook.ALTER_TABLE_OPERATION_TYPE, alterTbl.getOp().name());
       if (allPartitions == null) {
         db.alterTable(alterTbl.getOldName(), tbl, alterTbl.getIsCascade(), environmentContext);


Mime
View raw message