You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2021/03/11 14:23:41 UTC

[incubator-doris] branch master updated: [Bug][Spark Load] Spark Repository throws an exception when user configures `spark_ resource_ path` (#5417)

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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 89bfbdf  [Bug][Spark Load] Spark Repository throws an exception when user configures `spark_ resource_ path` (#5417)
89bfbdf is described below

commit 89bfbdf8115063a431c28dec70bcf8962d487950
Author: xy720 <22...@users.noreply.github.com>
AuthorDate: Thu Mar 11 22:23:26 2021 +0800

    [Bug][Spark Load] Spark Repository throws an exception when user configures `spark_ resource_ path` (#5417)
---
 .../main/java/org/apache/doris/load/loadv2/SparkRepository.java    | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java
index 3fc8bce..ebdf2f8 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/SparkRepository.java
@@ -190,15 +190,14 @@ public class SparkRepository {
             {
                 // 1. upload spark2x
                 srcFilePath = localSpark2xPath;
-                String fileName = getFileName(PATH_DELIMITER, srcFilePath);
                 String origFilePath = remoteArchivePath + PATH_DELIMITER +
-                        assemblyFileName(PREFIX_LIB, "", fileName, "");
+                        assemblyFileName(PREFIX_LIB, "", SPARK_2X, ".zip");
                 upload(srcFilePath, origFilePath);
                 // 2. rename spark2x
                 String md5sum = getMd5String(srcFilePath);
                 long size = getFileSize(srcFilePath);
                 String destFilePath = remoteArchivePath + PATH_DELIMITER +
-                        assemblyFileName(PREFIX_LIB, md5sum, fileName, "");
+                        assemblyFileName(PREFIX_LIB, md5sum, SPARK_2X, ".zip");
                 rename(origFilePath, destFilePath);
                 currentArchive.libraries.add(new SparkLibrary(destFilePath, md5sum, SparkLibrary.LibType.SPARK2X, size));
             }
@@ -306,7 +305,7 @@ public class SparkRepository {
     // output:  md5sum_spark-dpp-1.0.0-jar-with-dependencies
     private static String unwrap(String prefix, String fileName) {
         int pos = fileName.lastIndexOf(".");
-        return fileName.substring(prefix.length(), pos);
+        return fileName.substring(prefix.length(), pos > 0 ? pos : fileName.length());
     }
 
     private static String joinPrefix(String prefix, String fileName) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org