Return-Path: X-Original-To: apmail-bigtop-commits-archive@www.apache.org Delivered-To: apmail-bigtop-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B21C217FA6 for ; Thu, 28 Jan 2016 18:35:12 +0000 (UTC) Received: (qmail 40278 invoked by uid 500); 28 Jan 2016 18:35:09 -0000 Delivered-To: apmail-bigtop-commits-archive@bigtop.apache.org Received: (qmail 40237 invoked by uid 500); 28 Jan 2016 18:35:09 -0000 Mailing-List: contact commits-help@bigtop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: bigtop-dev@bigtop.apache.org Delivered-To: mailing list commits@bigtop.apache.org Received: (qmail 40228 invoked by uid 99); 28 Jan 2016 18:35:09 -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; Thu, 28 Jan 2016 18:35:09 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 554E6DFE61; Thu, 28 Jan 2016 18:35:09 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cos@apache.org To: commits@bigtop.apache.org Date: Thu, 28 Jan 2016 18:35:10 -0000 Message-Id: <7aecb61c9e164596932be21ca8bbd5e0@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [2/3] bigtop git commit: BIGTOP-2281: Add HIVE-12875 to Bigtop BIGTOP-2281: Add HIVE-12875 to Bigtop Project: http://git-wip-us.apache.org/repos/asf/bigtop/repo Commit: http://git-wip-us.apache.org/repos/asf/bigtop/commit/749c3945 Tree: http://git-wip-us.apache.org/repos/asf/bigtop/tree/749c3945 Diff: http://git-wip-us.apache.org/repos/asf/bigtop/diff/749c3945 Branch: refs/heads/master Commit: 749c39452b08820db660c0db625d065b2484d9f4 Parents: d60bfaf Author: Olaf Flebbe Authored: Wed Jan 27 14:36:26 2016 +0100 Committer: Olaf Flebbe Committed: Thu Jan 28 15:17:59 2016 +0100 ---------------------------------------------------------------------- .../src/common/hive/patch1-HIVE-12875.diff | 60 ++++++++++++++++++++ 1 file changed, 60 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/bigtop/blob/749c3945/bigtop-packages/src/common/hive/patch1-HIVE-12875.diff ---------------------------------------------------------------------- diff --git a/bigtop-packages/src/common/hive/patch1-HIVE-12875.diff b/bigtop-packages/src/common/hive/patch1-HIVE-12875.diff new file mode 100644 index 0000000..7a6acda --- /dev/null +++ b/bigtop-packages/src/common/hive/patch1-HIVE-12875.diff @@ -0,0 +1,60 @@ +--- apache-hive-1.2.1-src/ql/src/java/org/apache/hadoop/hive/ql/Driver.java.orig 2015-06-18 22:51:23.000000000 +0200 ++++ apache-hive-1.2.1-src/ql/src/java/org/apache/hadoop/hive/ql/Driver.java 2016-01-27 14:34:20.179641745 +0100 +@@ -33,6 +33,7 @@ + import java.util.Queue; + import java.util.Set; + ++import com.google.common.collect.Sets; + import org.apache.commons.lang.StringUtils; + import org.apache.commons.logging.Log; + import org.apache.commons.logging.LogFactory; +@@ -557,12 +558,27 @@ + */ + public static void doAuthorization(BaseSemanticAnalyzer sem, String command) + throws HiveException, AuthorizationException { +- HashSet inputs = sem.getInputs(); +- HashSet outputs = sem.getOutputs(); + SessionState ss = SessionState.get(); + HiveOperation op = ss.getHiveOperation(); + Hive db = sem.getDb(); + ++ Set additionalInputs = new HashSet(); ++ for (Entity e : sem.getInputs()) { ++ if (e.getType() == Entity.Type.PARTITION) { ++ additionalInputs.add(new ReadEntity(e.getTable())); ++ } ++ } ++ ++ Set additionalOutputs = new HashSet(); ++ for (Entity e : sem.getOutputs()) { ++ if (e.getType() == Entity.Type.PARTITION) { ++ additionalOutputs.add(new WriteEntity(e.getTable(), WriteEntity.WriteType.DDL_NO_LOCK)); ++ } ++ } ++ ++ Set inputs = Sets.union(sem.getInputs(), additionalInputs); ++ Set outputs = Sets.union(sem.getOutputs(), additionalOutputs); ++ + if (ss.isAuthorizationModeV2()) { + // get mapping of tables to columns used + ColumnAccessInfo colAccessInfo = sem.getColumnAccessInfo(); +@@ -759,8 +775,8 @@ + + } + +- private static void doAuthorizationV2(SessionState ss, HiveOperation op, HashSet inputs, +- HashSet outputs, String command, Map> tab2cols, ++ private static void doAuthorizationV2(SessionState ss, HiveOperation op, Set inputs, ++ Set outputs, String command, Map> tab2cols, + Map> updateTab2Cols) throws HiveException { + + /* comment for reviewers -> updateTab2Cols needed to be separate from tab2cols because if I +@@ -780,7 +796,7 @@ + } + + private static List getHivePrivObjects( +- HashSet privObjects, Map> tableName2Cols) { ++ Set privObjects, Map> tableName2Cols) { + List hivePrivobjs = new ArrayList(); + if(privObjects == null){ + return hivePrivobjs;