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

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


The following commit(s) were added to refs/heads/master by this push:
     new f1169d3c58b [regression-test](TRIM_DOUBLE_QUOTES) add case for 
TRIM_DOUBLE_QUOTES (#26998)
f1169d3c58b is described below

commit f1169d3c58b17de859aa368640fd995a27021615
Author: Guangdong Liu <liug...@gmail.com>
AuthorDate: Tue Nov 14 23:52:40 2023 +0800

    [regression-test](TRIM_DOUBLE_QUOTES) add case for TRIM_DOUBLE_QUOTES 
(#26998)
---
 .../data/load_p0/stream_load/test_stream_load.out  |  8 +++
 .../load_p0/stream_load/trim_double_quotes.csv     |  2 +
 .../load_p0/stream_load/test_stream_load.groovy    | 57 ++++++++++++++++++++++
 3 files changed, 67 insertions(+)

diff --git a/regression-test/data/load_p0/stream_load/test_stream_load.out 
b/regression-test/data/load_p0/stream_load/test_stream_load.out
index a89a09c301d..e6dcb15f231 100644
--- a/regression-test/data/load_p0/stream_load/test_stream_load.out
+++ b/regression-test/data/load_p0/stream_load/test_stream_load.out
@@ -131,3 +131,11 @@
 -1     50      1       1       3       \N
 1      50      1       1       3       \N
 
+-- !trim_double_quotes --
+1      test
+2      test
+
+-- !trim_double_quotes_false --
+1      "test"
+2      test
+
diff --git a/regression-test/data/load_p0/stream_load/trim_double_quotes.csv 
b/regression-test/data/load_p0/stream_load/trim_double_quotes.csv
new file mode 100644
index 00000000000..6450e58f2f8
--- /dev/null
+++ b/regression-test/data/load_p0/stream_load/trim_double_quotes.csv
@@ -0,0 +1,2 @@
+1|"test"
+2|test
diff --git a/regression-test/suites/load_p0/stream_load/test_stream_load.groovy 
b/regression-test/suites/load_p0/stream_load/test_stream_load.groovy
index 3e78a83a606..bb843f4e8bb 100644
--- a/regression-test/suites/load_p0/stream_load/test_stream_load.groovy
+++ b/regression-test/suites/load_p0/stream_load/test_stream_load.groovy
@@ -197,6 +197,7 @@ suite("test_stream_load", "p0") {
     def tableName10 = "test_struct"
     def tableName11 = "test_map"
     def tableName12 = "test_num_as_string"
+    def tableName17 = "test_trim_double_quotes"
 
     sql """ DROP TABLE IF EXISTS ${tableName3} """
     sql """ DROP TABLE IF EXISTS ${tableName4} """
@@ -207,6 +208,7 @@ suite("test_stream_load", "p0") {
     sql """ DROP TABLE IF EXISTS ${tableName10} """
     sql """ DROP TABLE IF EXISTS ${tableName11} """
     sql """ DROP TABLE IF EXISTS ${tableName12} """
+    sql """ DROP TABLE IF EXISTS ${tableName17} """
     sql """
     CREATE TABLE IF NOT EXISTS ${tableName3} (
       `k1` int(11) NULL,
@@ -350,6 +352,18 @@ suite("test_stream_load", "p0") {
     );
     """
 
+    sql """
+    CREATE TABLE IF NOT EXISTS ${tableName17} (
+      `k1` int(11) NULL,
+      `k2` VARCHAR(20) NULL
+    ) ENGINE=OLAP
+    DUPLICATE KEY(`k1`)
+    DISTRIBUTED BY HASH(`k1`) BUCKETS 3
+    PROPERTIES (
+    "replication_allocation" = "tag.location.default: 1"
+    );
+    """
+
     // test num_as_string
     streamLoad {
         table "${tableName12}"
@@ -1294,5 +1308,48 @@ suite("test_stream_load", "p0") {
             assertEquals("test comment", json.Comment)
         }
     }
+
+    // test trim_double_quotes
+    streamLoad {
+        table "${tableName17}"
+        set 'column_separator', '|'
+        set 'trim_double_quotes' +
+                '' +
+                '', 'true'
+        file 'trim_double_quotes.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())
+        }
+    }
+    sql "sync"
+    order_qt_trim_double_quotes "SELECT * FROM ${tableName17} order by k1"
+
+    sql """truncate table ${tableName17}"""
+    sql """sync"""
+
+    streamLoad {
+        table "${tableName17}"
+        set 'column_separator', '|'
+        set 'trim_double_quotes', 'false'
+        file 'trim_double_quotes.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())
+        }
+    }
+    sql "sync"
+    order_qt_trim_double_quotes_false "SELECT * FROM ${tableName17} order by 
k1"
+
 }
 


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

Reply via email to