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

commit 48d4601ee3800821b5a3801d91e6b3e9a2a099fb
Author: lw112 <131352377+felixw...@users.noreply.github.com>
AuthorDate: Fri May 31 11:58:19 2024 +0800

    [regression-test](load) add something like $.tag.[a.b] key's json case 
(#35134)
---
 .../data/load_p0/stream_load/test_json_load.out    |  3 +++
 .../load_p0/stream_load/test_special_key_json.json |  1 +
 .../load_p0/stream_load/test_json_load.groovy      | 26 ++++++++++++++++++++++
 3 files changed, 30 insertions(+)

diff --git a/regression-test/data/load_p0/stream_load/test_json_load.out 
b/regression-test/data/load_p0/stream_load/test_json_load.out
index 7351891633d..9f064572f13 100644
--- a/regression-test/data/load_p0/stream_load/test_json_load.out
+++ b/regression-test/data/load_p0/stream_load/test_json_load.out
@@ -245,3 +245,6 @@ John        30      New York        
{"email":"j...@example.com","phone":"+1-123-456-7890"}
 android        \N      \N      \N      \N      \N
 android        \N      \N      \N      \N      \N
 
+-- !select28 --
+test   k2_value
+
diff --git 
a/regression-test/data/load_p0/stream_load/test_special_key_json.json 
b/regression-test/data/load_p0/stream_load/test_special_key_json.json
new file mode 100644
index 00000000000..12bda2bf6c9
--- /dev/null
+++ b/regression-test/data/load_p0/stream_load/test_special_key_json.json
@@ -0,0 +1 @@
+{"tags": {"a.b": "test","k2": "k2_value"}}
diff --git a/regression-test/suites/load_p0/stream_load/test_json_load.groovy 
b/regression-test/suites/load_p0/stream_load/test_json_load.groovy
index f41610f3ba2..da6bea1afcd 100644
--- a/regression-test/suites/load_p0/stream_load/test_json_load.groovy
+++ b/regression-test/suites/load_p0/stream_load/test_json_load.groovy
@@ -827,4 +827,30 @@ suite("test_json_load", "p0") {
     } finally {
         try_sql("DROP TABLE IF EXISTS ${testTable}")
     }
+
+    // add something like $.tag. [a.b] key's json case
+    try {
+        sql "DROP TABLE IF EXISTS ${testTable}"
+        sql """CREATE TABLE IF NOT EXISTS ${testTable} 
+            (
+                `k1` varchar(1024) NULL,
+                `k2` varchar(1024) NULL
+            )
+            DUPLICATE KEY(`k1`)
+            COMMENT ''
+            DISTRIBUTED BY RANDOM BUCKETS 1
+            PROPERTIES (
+            "replication_allocation" = "tag.location.default: 1"
+            );"""
+
+        load_json_data.call("${testTable}", "${testTable}_case28_1", 'false', 
'', 'json', '', '[\"$.tags.\\\"a.b\\\"\",\"$.tags.k2\"]',
+                             '', '', '', 'test_special_key_json.json')
+        
+        sql "sync"
+        sleep(1000)
+        qt_select28 "select * from ${testTable}"
+
+    } finally {
+        try_sql("DROP TABLE IF EXISTS ${testTable}")
+    }
 }


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

Reply via email to