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

kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-dolphinscheduler.git


The following commit(s) were added to refs/heads/dev by this push:
     new 03c7e1f  [Fix][UDF] Fix udf jar path not exist when fs.defaultFS 
starts with file:/// (#4692)
03c7e1f is described below

commit 03c7e1f368e1fc995155140b2b4d3960b4475c96
Author: Shiwen Cheng <[email protected]>
AuthorDate: Fri Feb 5 14:09:02 2021 +0800

    [Fix][UDF] Fix udf jar path not exist when fs.defaultFS starts with 
file:/// (#4692)
---
 .../java/org/apache/dolphinscheduler/server/utils/UDFUtils.java     | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git 
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/UDFUtils.java
 
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/UDFUtils.java
index 1bc79ab..71234f5 100644
--- 
a/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/UDFUtils.java
+++ 
b/dolphinscheduler-server/src/main/java/org/apache/dolphinscheduler/server/utils/UDFUtils.java
@@ -73,13 +73,11 @@ public class UDFUtils {
         String resourceFullName;
         Set<Map.Entry<UdfFunc,String>> entries = 
udfFuncTenantCodeMap.entrySet();
         for (Map.Entry<UdfFunc,String> entry:entries){
+            String prefixPath = defaultFS.startsWith("file://") ? "file://" : 
defaultFS;
             String uploadPath = HadoopUtils.getHdfsUdfDir(entry.getValue());
-            if (!uploadPath.startsWith("hdfs:")) {
-                uploadPath = defaultFS + uploadPath;
-            }
             resourceFullName = entry.getKey().getResourceName();
             resourceFullName = resourceFullName.startsWith("/") ? 
resourceFullName : String.format("/%s",resourceFullName);
-            sqls.add(String.format("add jar %s%s", uploadPath, 
resourceFullName));
+            sqls.add(String.format("add jar %s%s%s", prefixPath, uploadPath, 
resourceFullName));
         }
 
     }

Reply via email to