From 9c1a971da4d7a5b2e9ac2148a11f605c0b619686 Mon Sep 17 00:00:00 2001 From: Shiwen Cheng Date: Fri, 5 Feb 2021 14:13:04 +0800 Subject: [PATCH] [Fix][UDF] Fix udf jar path not exist when fs.defaultFS starts with file:/// (#4693) --- .../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 1bc79ab94..71234f553 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> entries = udfFuncTenantCodeMap.entrySet(); for (Map.Entry 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)); } } -- GitLab