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-13911 : load inpath fails throwing org.apache.hadoop.security.AccessControlException (Hari Sankar Subramaniyan via Ashutosh Chauhan)
Date Tue, 07 Jun 2016 15:31:36 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.1 e66519933 -> 13cfe08ec


HIVE-13911 : load inpath fails throwing org.apache.hadoop.security.AccessControlException
(Hari Sankar Subramaniyan 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/13cfe08e
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/13cfe08e
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/13cfe08e

Branch: refs/heads/branch-2.1
Commit: 13cfe08ecf2cd6a55a458de5da3eedf1a5a4a7e1
Parents: e665199
Author: Hari Subramaniyan <harisankar@apache.org>
Authored: Wed Jun 1 16:57:00 2016 -0800
Committer: Ashutosh Chauhan <hashutosh@apache.org>
Committed: Tue Jun 7 08:31:18 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/hadoop/hive/ql/metadata/Hive.java  | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/13cfe08e/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
index 16d9b03..2b01fce 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java
@@ -2680,19 +2680,24 @@ private void constructOneLBLocationMap(FileStatus fSta,
           name = itemName;
           filetype = "";
         }
-
-        final String srcGroup = srcFile.getGroup();
+        final boolean renameNonLocal = !needToCopy && !isSrcLocal;
+        // If we do a rename for a non-local file, we will be transfering the original
+        // file permissions from source to the destination. Else, in case of mvFile() where
we
+        // copy from source to destination, we will inherit the destination's parent group
ownership.
+        final String srcGroup = renameNonLocal ? srcFile.getGroup() :
+          fullDestStatus.getFileStatus().getGroup();
         if (null == pool) {
           Path destPath = new Path(destf, srcP.getName());
           try {
 
-            if (!needToCopy && !isSrcLocal) {
+            if (renameNonLocal) {
               for (int counter = 1; !destFs.rename(srcP,destPath); counter++) {
                 destPath = new Path(destf, name + ("_copy_" + counter) + filetype);
               }
             } else {
               destPath = mvFile(conf, srcP, destPath, isSrcLocal, srcFs, destFs, name, filetype);
             }
+
             if (null != newFiles) {
               newFiles.add(destPath);
             }
@@ -2706,7 +2711,7 @@ private void constructOneLBLocationMap(FileStatus fSta,
             public ObjectPair<Path, Path> call() throws Exception {
               SessionState.setCurrentSessionState(parentSession);
               Path destPath = new Path(destf, srcP.getName());
-              if (!needToCopy && !isSrcLocal) {
+              if (renameNonLocal) {
                 for (int counter = 1; !destFs.rename(srcP,destPath); counter++) {
                   destPath = new Path(destf, name + ("_copy_" + counter) + filetype);
                 }


Mime
View raw message