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

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


The following commit(s) were added to refs/heads/branch-2.1 by this push:
     new 8356141e033 branch-2.1: [enhancement](case) add cases for mow table 
load empty file #49843 (#49858)
8356141e033 is described below

commit 8356141e03383c24043fff1d194af9f819c34843
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Tue Apr 8 14:04:30 2025 +0800

    branch-2.1: [enhancement](case) add cases for mow table load empty file 
#49843 (#49858)
    
    Cherry-picked from #49843
    
    Co-authored-by: MoanasDaddyXu <xujia...@selectdb.com>
---
 .../stream_load/test_stream_load_empty_file.out    | Bin 107 -> 120 bytes
 .../stream_load/test_stream_load_empty_file.groovy |  64 ++++++++++++++++++++-
 2 files changed, 63 insertions(+), 1 deletion(-)

diff --git 
a/regression-test/data/load_p0/stream_load/test_stream_load_empty_file.out 
b/regression-test/data/load_p0/stream_load/test_stream_load_empty_file.out
index 9c9c4c6c8a2..ad072ac6974 100644
Binary files 
a/regression-test/data/load_p0/stream_load/test_stream_load_empty_file.out and 
b/regression-test/data/load_p0/stream_load/test_stream_load_empty_file.out 
differ
diff --git 
a/regression-test/suites/load_p0/stream_load/test_stream_load_empty_file.groovy 
b/regression-test/suites/load_p0/stream_load/test_stream_load_empty_file.groovy
index 9265280ecae..a5e03031c6e 100644
--- 
a/regression-test/suites/load_p0/stream_load/test_stream_load_empty_file.groovy
+++ 
b/regression-test/suites/load_p0/stream_load/test_stream_load_empty_file.groovy
@@ -17,6 +17,7 @@
 
 suite("test_stream_load_empty_file", "p0") {
     def tableName = "test_stream_load_empty_file"
+    def mowTableName = "test_stream_mow_load_empty_file"
     try {
         sql """ DROP TABLE IF EXISTS ${tableName} """
         sql """
@@ -66,8 +67,69 @@ suite("test_stream_load_empty_file", "p0") {
         }
 
         sql "sync"
-        qt_sql "select * from ${tableName}"
+        qt_sql1 "select * from ${tableName}"
     } finally {
         sql """ DROP TABLE IF EXISTS ${tableName} """
     }
+
+    try {
+        sql """ DROP TABLE IF EXISTS ${mowTableName} """
+        sql """
+            CREATE TABLE IF NOT EXISTS ${mowTableName} (
+                `k1` bigint(20) NULL,
+                `k2` bigint(20) NULL,
+                `v1` tinyint(4) NULL,
+                `v2` tinyint(4) NULL,
+                `v3` tinyint(4) NULL,
+                `v4` smallint(6) NULL,
+                `v5` int(11) NULL,
+                `v6` bigint(20) NULL,
+                `v7` largeint(40) NULL,
+                `v8` datetime NULL,
+                `v9` date NULL,
+                `v10` char(10) NULL,
+                `v11` varchar(6) NULL,
+                `v12` decimal(27, 9) NULL
+            ) ENGINE=OLAP
+            UNIQUE KEY(`k1`, `k2`)
+            COMMENT 'OLAP'
+            PARTITION BY RANGE(`k1`)
+            (PARTITION partition_a VALUES [("-9223372036854775808"), 
("100000")),
+            PARTITION partition_b VALUES [("100000"), ("1000000000")),
+            PARTITION partition_c VALUES [("1000000000"), ("10000000000")),
+            PARTITION partition_d VALUES [("10000000000"), (MAXVALUE)))
+            DISTRIBUTED BY HASH(`k1`, `k2`) BUCKETS 3
+            PROPERTIES 
+            (
+            "replication_allocation" = "tag.location.default: 1",
+            "enable_unique_key_merge_on_write" = "true"
+            );
+        """
+
+        // test strict_mode success
+        streamLoad {
+            table "${mowTableName}"
+
+            file 'test_empty_file.csv'
+
+            check { result, exception, startTime, endTime ->
+                if (exception != null) {
+                    throw exception
+                }
+                log.info("Stream load result: ${result}".toString())
+                def json = parseJson(result)
+                assertEquals("success", json.Status.toLowerCase())
+                assertEquals(0, json.NumberTotalRows)
+            }
+            time 10000 // limit inflight 10s
+        }
+
+        sql "sync"
+        qt_sql2 "select * from ${mowTableName}"
+    } finally {
+        sql """ DROP TABLE IF EXISTS ${mowTableName} """
+    }
+
+
+
 }
\ No newline at end of file


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

Reply via email to