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

morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 89927436379 branch-3.1: [fix](load) fix s3 load check failed when no 
source file found #56319 (#56376)
89927436379 is described below

commit 89927436379ed1d1946f4f0b27a4ffb24a4f5a89
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Sep 25 17:39:48 2025 +0800

    branch-3.1: [fix](load) fix s3 load check failed when no source file found 
#56319 (#56376)
    
    Cherry-picked from #56319
    
    Co-authored-by: Xin Liao <[email protected]>
---
 .../doris/load/loadv2/BrokerLoadPendingTask.java   |  2 +
 .../broker_load/test_s3_load_with_no_file.groovy   | 74 ++++++++++++++++++++++
 2 files changed, 76 insertions(+)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadPendingTask.java
 
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadPendingTask.java
index e483aed2b97..cdf09b65c37 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadPendingTask.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/load/loadv2/BrokerLoadPendingTask.java
@@ -131,6 +131,8 @@ public class BrokerLoadPendingTask extends LoadTask {
                                 groupNum, entry.getKey(), 
callback.getCallbackId(),
                                 brokerDesc.getStorageType() == 
StorageBackend.StorageType.BROKER
                                         ? BrokerUtil.getAddress(brokerDesc) : 
brokerDesc.getStorageType());
+                        throw new UserException("No source files found in the 
specified paths: "
+                                + fileGroup.getFilePaths());
                     }
                     groupNum++;
                 }
diff --git 
a/regression-test/suites/load_p0/broker_load/test_s3_load_with_no_file.groovy 
b/regression-test/suites/load_p0/broker_load/test_s3_load_with_no_file.groovy
new file mode 100644
index 00000000000..3ea93a5ce2d
--- /dev/null
+++ 
b/regression-test/suites/load_p0/broker_load/test_s3_load_with_no_file.groovy
@@ -0,0 +1,74 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+suite("test_s3_load_with_no_file", "load_p0") {
+    def tableName = "tbl_with_no_file"
+
+    sql """ DROP TABLE IF EXISTS ${tableName} """
+
+    sql """
+        CREATE TABLE ${tableName} (
+             user_id            BIGINT       NOT NULL COMMENT "用户 ID",
+             name               VARCHAR(20)           COMMENT "用户姓名",
+             age                INT                   COMMENT "用户年龄"
+         ) DUPLICATE KEY(user_id)
+         DISTRIBUTED BY HASH(user_id) BUCKETS 1
+         PROPERTIES (
+             "replication_num" = "1"
+         )
+    """
+
+    def label = UUID.randomUUID().toString().replace("-", "0")
+
+    def sql_str = """
+            LOAD LABEL $label (
+                DATA 
INFILE("s3://${s3BucketName}/regression/load/data/xxxx_no_file.csv")
+                INTO TABLE $tableName
+                COLUMNS TERMINATED BY ","
+            )
+            WITH S3 (
+                "AWS_ENDPOINT" = "${getS3Endpoint()}",
+                "PROVIDER" = "${getS3Provider()}",
+                "AWS_ACCESS_KEY" = "${getS3AK()}",
+                "AWS_SECRET_KEY" = "${getS3SK()}"
+            )
+            """
+    logger.info("submit sql: ${sql_str}");
+    sql """${sql_str}"""
+
+    def max_try_milli_secs = 600000
+    while (max_try_milli_secs > 0) {
+        String[][] result = sql """ show load where label="$label" order by 
createtime desc limit 1; """
+        logger.info("show load result: " + result[0])
+        if (result[0][2].equals("FINISHED")) {
+            logger.info("Load FINISHED " + label)
+            assertTrue(1 == 2)
+            break
+        }
+        if (result[0][2].equals("CANCELLED")) {
+            def reason = result[0][7]
+            logger.info("load failed, reason:$reason")
+            assertTrue(reason.contains("No source files found"))
+            break
+        }
+        Thread.sleep(1000)
+        max_try_milli_secs -= 1000
+        if(max_try_milli_secs <= 0) {
+            assertTrue(1 == 2, "load Timeout: $label")
+        }
+    }
+}


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

Reply via email to