FAQ
Repository: hive
Updated Branches:
   refs/heads/master 76a3d5e37 -> b7de5b81b


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/b7de5b81
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b7de5b81
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b7de5b81

Branch: refs/heads/master
Commit: b7de5b81b32ff901d23e6241a64f204622d3c6af
Parents: 76a3d5e
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:30:12 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/b7de5b81/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);
                  }

Search Discussions

  • Hashutosh at Jun 7, 2016 at 3:31 pm
    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);
                      }

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupcommits @
categorieshive, hadoop
postedJun 7, '16 at 3:30p
activeJun 7, '16 at 3:31p
posts2
users1
websitehive.apache.org

1 user in discussion

Hashutosh: 2 posts

People

Translate

site design / logo © 2021 Grokbase