HIVE-11695 : If user have no permission to  create LOCAL DIRECTORY ,the Hql 
does not throw any exception and fail silently. (WangMeng via Ashutosh Chauhan)

Signed-off-by: Ashutosh Chauhan <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/b934a804
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/b934a804
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/b934a804

Branch: refs/heads/beeline-cli
Commit: b934a804a75b7e01cf5ff043db4cc54c82d91641
Parents: c7de9b9
Author: WangMeng <[email protected]>
Authored: Wed Sep 16 21:00:00 2015 -0800
Committer: Ashutosh Chauhan <[email protected]>
Committed: Fri Sep 18 10:10:47 2015 -0700

----------------------------------------------------------------------
 ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/b934a804/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
----------------------------------------------------------------------
diff --git a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java 
b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
index 6a19cc3..7e257e5 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/exec/MoveTask.java
@@ -132,7 +132,10 @@ public class MoveTask extends Task<MoveWork> implements 
Serializable {
           try {
             // create the destination if it does not exist
             if (!dstFs.exists(targetPath)) {
-              FileUtils.mkdir(dstFs, targetPath, false, conf);
+              if (!FileUtils.mkdir(dstFs, targetPath, false, conf)) {
+                throw new HiveException(
+                    "Failed to create local target directory for copy:" + 
targetPath);
+              }
             }
           } catch (IOException e) {
             throw new HiveException("Unable to create target directory for 
copy" + targetPath, e);

Reply via email to