diff --git ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java index 7172328..948d60b 100644 --- ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java +++ ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java @@ -2147,7 +2147,7 @@ public boolean grantRole(String roleName, String userName, boolean grantOption) throws HiveException { try { return getMSC().grant_role(roleName, userName, principalType, grantor, - grantorType, grantOption); + grantorType, grantOption); } catch (Exception e) { throw new HiveException(e); } @@ -2316,6 +2316,15 @@ private static boolean destExists(List> result, Path proposed) { return false; } + private static boolean isSubDir(Path srcf, Path destf, FileSystem fs){ + // If the source file is in the file schema, it can not be the subdirectory of a HDFS path + if (srcf != null && srcf.toUri().isAbsolute() && srcf.toUri().getScheme().equals("file")) { + return false; + } else { + return FileUtils.isSubDir(srcf, destf, fs); + } + } + //it is assumed that parent directory of the destf should already exist when this //method is called. when the replace value is true, this method works a little different //from mv command if the destf is a directory, it replaces the destf instead of moving under @@ -2337,7 +2346,7 @@ public static boolean moveFile(HiveConf conf, Path srcf, Path destf, // (1) Do not delete the dest dir before doing the move operation. // (2) It is assumed that subdir and dir are in same encryption zone. // (3) Move individual files from scr dir to dest dir. - boolean destIsSubDir = FileUtils.isSubDir(srcf, destf, fs); + boolean destIsSubDir = isSubDir(srcf, destf, fs); try { if (inheritPerms || replace) { try{