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

vihangk1 pushed a commit to branch branch-3
in repository https://gitbox.apache.org/repos/asf/hive.git


The following commit(s) were added to refs/heads/branch-3 by this push:
     new 4cd5142aa4e HIVE-27678: Backport HIVE-26127 to branch-3 (Vihang 
Karajgaonkar reviewed by  Ayush Saxena)
4cd5142aa4e is described below

commit 4cd5142aa4e2e1795593ba03305da21fd4dd6fb1
Author: Vihang Karajgaonkar <27933586+vihan...@users.noreply.github.com>
AuthorDate: Sat Sep 9 22:18:23 2023 -0700

    HIVE-27678: Backport HIVE-26127 to branch-3 (Vihang Karajgaonkar reviewed 
by  Ayush Saxena)
---
 ql/src/java/org/apache/hadoop/hive/ql/metadata/Hive.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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 024fc64d924..0e0cfbc531d 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
@@ -4278,7 +4278,7 @@ private void constructOneLBLocationMap(FileStatus fSta,
       // But not sure why we changed not to delete the oldPath in HIVE-8750 if 
it is
       // not the destf or its subdir?
       isOldPathUnderDestf = isSubDir(oldPath, destPath, oldFs, destFs, false);
-      if (isOldPathUnderDestf) {
+      if (isOldPathUnderDestf && oldFs.exists(oldPath)) {
         cleanUpOneDirectoryForReplace(oldPath, oldFs, pathFilter, conf, purge, 
isNeedRecycle);
       }
     } catch (IOException e) {

Reply via email to