You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hive.apache.org by ng...@apache.org on 2021/10/06 00:47:15 UTC

[hive] branch master updated: HIVE-25570: Hive should send full URL path for authorization for command 'insert overwrite location'(Saihemanth via Naveen Gangam)

This is an automated email from the ASF dual-hosted git repository.

ngangam pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/master by this push:
     new a3d302f  HIVE-25570: Hive should send full URL path for authorization for command 'insert overwrite location'(Saihemanth via Naveen Gangam)
a3d302f is described below

commit a3d302ff7047898745bb556ebe8d2e1cb49549b2
Author: saihemanth <sa...@cloudera.com>
AuthorDate: Wed Sep 29 09:15:16 2021 -0700

    HIVE-25570: Hive should send full URL path for authorization for command 'insert overwrite location'(Saihemanth via Naveen Gangam)
---
 .../org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
index 909853e..a8caf26 100644
--- a/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
+++ b/ql/src/java/org/apache/hadoop/hive/ql/parse/SemanticAnalyzer.java
@@ -7793,9 +7793,14 @@ public class SemanticAnalyzer extends BaseSemanticAnalyzer {
             isMmCreate);
         loadFileDesc.setMoveTaskId(moveTaskId);
         loadFileWork.add(loadFileDesc);
-        if (!outputs.add(new WriteEntity(destinationPath, !isDfsDir, isDestTempFile))) {
-          throw new SemanticException(ErrorMsg.OUTPUT_SPECIFIED_MULTIPLE_TIMES
-              .getMsg(destinationPath.toUri().toString()));
+        try {
+          Path qualifiedPath = destinationPath.getFileSystem(conf).makeQualified(destinationPath);
+          if (!outputs.add(new WriteEntity(qualifiedPath, !isDfsDir, isDestTempFile))) {
+            throw new SemanticException(ErrorMsg.OUTPUT_SPECIFIED_MULTIPLE_TIMES
+                    .getMsg(destinationPath.toUri().toString()));
+          }
+        } catch (IOException ex) {
+          throw new SemanticException("Error while getting the full qualified path for the given directory: " + ex.getMessage());
         }
       }
       break;