From commits-return-32504-archive-asf-public=cust-asf.ponee.io@hive.apache.org Fri Apr 13 07:40:14 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id ECAC2180627 for ; Fri, 13 Apr 2018 07:40:13 +0200 (CEST) Received: (qmail 98474 invoked by uid 500); 13 Apr 2018 05:40:12 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 98462 invoked by uid 99); 13 Apr 2018 05:40:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2018 05:40:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 4E7E5E0630; Fri, 13 Apr 2018 05:40:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: hashutosh@apache.org To: commits@hive.apache.org Message-Id: <62b85f1ba1cb4783a6baac65e7b55d1e@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) 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 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 Authored: Thu Apr 12 22:39:37 2018 -0700 Committer: Ashutosh Chauhan 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 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);