ayushtkn commented on a change in pull request #3160:
URL: https://github.com/apache/hive/pull/3160#discussion_r839834104



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/exec/tez/DagUtils.java
##########
@@ -1424,10 +1433,9 @@ public LocalResource localizeResource(
         return createLocalResource(destFS, dest, type, 
LocalResourceVisibility.PRIVATE);
       }
       try {
-        if (src.toUri().getScheme()!=null) {
-          FileUtil.copy(src.getFileSystem(conf), src, destFS, dest, false, 
false, conf);
-        }
-        else {
+        if (!isSrcLocal) {
+          FileUtil.copy(srcFs, src, destFS, dest, false, false, conf);
+        } else {
           destFS.copyFromLocalFile(false, false, src, dest);

Review comment:
       Guess we can ditch the if-else and ``isSrcLocal`` part.
   ``destFS.copyFromLocalFile(false, false, src, dest);``  resolves to 
   ``FileUtil.copy(getLocal(conf), src, this, dst, delSrc, overwrite, conf);``
   which is technically same as the above `FileUtils.copy.` 
   The FileSystem anyway we have resolved to Local above :
   ```
   } else {
     srcFs = FileSystem.getLocal(conf);
   }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to