bigtop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject [2/3] bigtop git commit: BIGTOP-2281: Add HIVE-12875 to Bigtop
Date Thu, 28 Jan 2016 18:35:10 GMT
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 <of@ofleb.be>
Authored: Wed Jan 27 14:36:26 2016 +0100
Committer: Olaf Flebbe <of@oflebbe.de>
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<ReadEntity> inputs = sem.getInputs();
+-    HashSet<WriteEntity> outputs = sem.getOutputs();
+     SessionState ss = SessionState.get();
+     HiveOperation op = ss.getHiveOperation();
+     Hive db = sem.getDb();
+ 
++    Set<ReadEntity> additionalInputs = new HashSet<ReadEntity>();
++    for (Entity e : sem.getInputs()) {
++      if (e.getType() == Entity.Type.PARTITION) {
++        additionalInputs.add(new ReadEntity(e.getTable()));
++      }
++    }
++
++    Set<WriteEntity> additionalOutputs = new HashSet<WriteEntity>();
++    for (Entity e : sem.getOutputs()) {
++      if (e.getType() == Entity.Type.PARTITION) {
++        additionalOutputs.add(new WriteEntity(e.getTable(), WriteEntity.WriteType.DDL_NO_LOCK));
++      }
++    }
++
++    Set<ReadEntity> inputs = Sets.union(sem.getInputs(), additionalInputs);
++    Set<WriteEntity> 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<ReadEntity>
inputs,
+-      HashSet<WriteEntity> outputs, String command, Map<String, List<String>>
tab2cols,
++  private static void doAuthorizationV2(SessionState ss, HiveOperation op, Set<ReadEntity>
inputs,
++      Set<WriteEntity> outputs, String command, Map<String, List<String>>
tab2cols,
+       Map<String, List<String>> updateTab2Cols) throws HiveException {
+ 
+     /* comment for reviewers -> updateTab2Cols needed to be separate from tab2cols because
if I
+@@ -780,7 +796,7 @@
+   }
+ 
+   private static List<HivePrivilegeObject> getHivePrivObjects(
+-      HashSet<? extends Entity> privObjects, Map<String, List<String>>
tableName2Cols) {
++      Set<? extends Entity> privObjects, Map<String, List<String>> tableName2Cols)
{
+     List<HivePrivilegeObject> hivePrivobjs = new ArrayList<HivePrivilegeObject>();
+     if(privObjects == null){
+       return hivePrivobjs;


Mime
View raw message