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

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

commit 3dab722500f3062e0938d88d019736cd579bbe10
Author: amory <wangqian...@selectdb.com>
AuthorDate: Tue Oct 17 10:16:52 2023 +0800

    [cases](regresstest)add json format regress test for nested types (#25397)
---
 .../test_nestedtypes_json_insert_into_with_s3.out  |  18 +-
 ...est_nestedtypes_json_insert_into_with_s3.groovy | 253 +++++++++++++++++++++
 2 files changed, 262 insertions(+), 9 deletions(-)

diff --git 
a/regression-test/data/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.out
 
b/regression-test/data/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.out
index 21fb51ac176..a125a032e3c 100644
--- 
a/regression-test/data/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.out
+++ 
b/regression-test/data/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.out
@@ -1,33 +1,33 @@
 -- This file is automatically generated. You should know what you did if you 
want to edit this
 -- !sql_arr_json_without_quote_s3 --
-0      
[false,true,false,true,true,true,false,false,false,false,false,true,true,true,false,false,true,true,true,false,false,false,false,true,false,true,true,false,true,false,true,false,true,false,true,true,false,false,true,true,false,false,true,true,false,true,false,true,true,false,false,true,true,false,false,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,false,true,false,true,true,true,true,false,false,false,true,true,true,false,true,false,false,false,false
 [...]
+0      
[false,true,false,true,true,true,false,false,false,false,false,true,true,true,false,false,true,true,true,false,false,false,false,true,false,true,true,false,true,false,true,false,true,false,true,true,false,false,true,true,false,false,true,true,false,true,false,true,true,false,false,true,true,false,false,true,true,true,true,false,false,false,false,false,false,false,true,true,true,true,false,true,false,true,true,true,true,false,false,false,true,true,true,false,true,false,false,false,false
 [...]
 
 -- !sql_arr_json_without_quote_doris --
-0      [0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 
1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 
0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 
1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1]    
[NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NU [...]
+0      [0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 0, 0, 
1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 1, 1, 
0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 
1, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 1]    
[NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 
NULL, NULL, NULL, NULL, NULL, NU [...]
 
 -- !sql_arr_json_without_quote_s3 --
-0      
[[false,true],[true,true],[false,false],[],[false],[false],[],[],[],[false,false],[],[],[true],[true],[false],[true],[true],[],[true,false],[],[],[false],[false],[],[true,false],[false,true],[],[false,false],[true,false],[false,true],[false,false],[],[],[true],[true],[true],[],[],[false,true],[false,false],[],[],[true,false],[false],[false],[true],[],[],[],[true],[false,false],[true,false],[false,false],[false],[false,true],[],[false],[false,true],[false,false],[],[false],[true],[],[],
 [...]
+0      
[[false,true],[true,true],[false,false],[],[false],[false],[],[],[],[false,false],[],[],[true],[true],[false],[true],[true],[],[true,false],[],[],[false],[false],[],[true,false],[false,true],[],[false,false],[true,false],[false,true],[false,false],[],[],[true],[true],[true],[],[],[false,true],[false,false],[],[],[true,false],[false],[false],[true],[],[],[],[true],[false,false],[true,false],[false,false],[false],[false,true],[],[false],[false,true],[false,false],[],[false],[true],[],[],
 [...]
 
 -- !sql_arr_json_without_quote_doris --
-0      [[0, 1], [1, 1], [0, 0], [], [0], [0], [], [], [], [0, 0], [], [], [1], 
[1], [0], [1], [1], [], [1, 0], [], [], [0], [0], [], [1, 0], [0, 1], [], [0, 
0], [1, 0], [0, 1], [0, 0], [], [], [1], [1], [1], [], [], [0, 1], [0, 0], [], 
[], [1, 0], [0], [0], [1], [], [], [], [1], [0, 0], [1, 0], [0, 0], [0], [0, 
1], [], [0], [0, 1], [0, 0], [], [0], [1], [], [], [], [1, 0], [], [], [1], 
[1], [], [], [1, 0], [1, 0], [0, 0], [], [], [0, 0], [0, 1], [1], [1], [1], [1, 
0], [1], [], [0, 0], [], [0, [...]
+0      [[0, 1], [1, 1], [0, 0], [], [0], [0], [], [], [], [0, 0], [], [], [1], 
[1], [0], [1], [1], [], [1, 0], [], [], [0], [0], [], [1, 0], [0, 1], [], [0, 
0], [1, 0], [0, 1], [0, 0], [], [], [1], [1], [1], [], [], [0, 1], [0, 0], [], 
[], [1, 0], [0], [0], [1], [], [], [], [1], [0, 0], [1, 0], [0, 0], [0], [0, 
1], [], [0], [0, 1], [0, 0], [], [0], [1], [], [], [], [1, 0], [], [], [1], 
[1], [], [], [1, 0], [1, 0], [0, 0], [], [], [0, 0], [0, 1], [1], [1], [1], [1, 
0], [1], [], [0, 0], [], [0, [...]
 
 -- !sql_arr_json_without_quote_s3 --
-0      {"false":true,"true":true}      
{"-64":-114,"5":87,"-128":-34,"-59":100,"-54":-124,"-91":2,"-7":14,"-96":-88,"25":6,"-108":91,"46":89,"93":6,"-3":-21,"78":118,"29":103,"-127":5,"106":75,"121":-63,"84":-107,"-104":-53,"61":-14,"-44":98,"6":-50,"60":-120,"117":86,"38":50,"70":45,"33":39,"65":-43,"-119":-115,"-4":-68,"-36":80,"9":36,"53":95,"-55":-70,"77":115,"-19":-63,"13":60,"-51":23,"41":109,"73":-82,"32":-47,"34":122,"-42":-16,"44":17,"118":-103,"-101":14,"39":31,"-52":-98,"-106":-85,"48":
 [...]
+0      {"false":true,"true":true}      
{"-64":-114,"5":87,"-128":-34,"-59":100,"-54":-124,"-91":2,"-7":14,"-96":-88,"25":6,"-108":91,"46":89,"93":6,"-3":-21,"78":118,"29":103,"-127":5,"106":75,"121":-63,"84":-107,"-104":-53,"61":-14,"-44":98,"6":-50,"60":-120,"117":86,"38":50,"70":45,"33":39,"65":-43,"-119":-115,"-4":-68,"-36":80,"9":36,"53":95,"-55":-70,"77":115,"-19":-63,"13":60,"-51":23,"41":109,"73":-82,"32":-47,"34":122,"-42":-16,"44":17,"118":-103,"-101":14,"39":31,"-52":-98,"-106":-85,"48":
 [...]
 
 -- !sql_arr_json_without_quote_doris --
-0      {0:1, 1:1}      {-64:-114, 5:87, -128:-34, -59:100, -54:-124, -91:2, 
-7:14, -96:-88, 25:6, -108:91, 46:89, 93:6, -3:-21, 78:118, 29:103, -127:5, 
106:75, 121:-63, 84:-107, -104:-53, 61:-14, -44:98, 6:-50, 60:-120, 117:86, 
38:50, 70:45, 33:39, 65:-43, -119:-115, -4:-68, -36:80, 9:36, 53:95, -55:-70, 
77:115, -19:-63, 13:60, -51:23, 41:109, 73:-82, 32:-47, 34:122, -42:-16, 44:17, 
118:-103, -101:14, 39:31, -52:-98, -106:-85, 48:126, 63:92, -46:1, -1:-89, 
16:-38, -14:97, -21:-69, 11:-6, 72:57, -3 [...]
+0      {0:1, 1:1}      {-64:-114, 5:87, -128:-34, -59:100, -54:-124, -91:2, 
-7:14, -96:-88, 25:6, -108:91, 46:89, 93:6, -3:-21, 78:118, 29:103, -127:5, 
106:75, 121:-63, 84:-107, -104:-53, 61:-14, -44:98, 6:-50, 60:-120, 117:86, 
38:50, 70:45, 33:39, 65:-43, -119:-115, -4:-68, -36:80, 9:36, 53:95, -55:-70, 
77:115, -19:-63, 13:60, -51:23, 41:109, 73:-82, 32:-47, 34:122, -42:-16, 44:17, 
118:-103, -101:14, 39:31, -52:-98, -106:-85, 48:126, 63:92, -46:1, -1:-89, 
16:-38, -14:97, -21:-69, 11:-6, 72:57, -3 [...]
 
 -- !sql_arr_json_without_quote_s3 --
-0      
[{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true
 [...]
+0      
[{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true,"true":false},{"false":true
 [...]
 
 -- !sql_arr_json_without_quote_doris --
 0      [{0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 
1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, 
{0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 
1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, 
{0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 
1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0}, 
{0:1, 1:0}, {0:1, 1:0}, {0:1, 1:0 [...]
 
 -- !sql_arr_json_without_quote_s3 --
-0      {"true":[true,false,false],"false":[false,true,false]}  
{"101":[-38,-115,35],"-59":[-113,-128,110],"10":[-78,-127,16],"56":[108,-40,124],"-22":[-63,-88,-24],"37":[-7,81,-20],"14":[-114,95,-3],"110":[71,-72,-84],"125":[1,110,56],"-40":[-13,19,80],"20":[-41,-115,107],"46":[82,-104,-30],"57":[116,68,88],"-104":[-64,119,31],"-72":[-65,-44,27],"1":[-127,-73,81],"74":[81,-82,-32],"-99":[-70,37,55],"60":[89,112,124],"-58":[-69,50,-56],"102":[27,-17,-9],"-68":[-112,20,91],"-43":[75,21,76],"33":
 [...]
+0      {"true":[true,false,false],"false":[false,true,false]}  
{"101":[-38,-115,35],"-59":[-113,-128,110],"10":[-78,-127,16],"56":[108,-40,124],"-22":[-63,-88,-24],"37":[-7,81,-20],"14":[-114,95,-3],"110":[71,-72,-84],"125":[1,110,56],"-40":[-13,19,80],"20":[-41,-115,107],"46":[82,-104,-30],"57":[116,68,88],"-104":[-64,119,31],"-72":[-65,-44,27],"1":[-127,-73,81],"74":[81,-82,-32],"-99":[-70,37,55],"60":[89,112,124],"-58":[-69,50,-56],"102":[27,-17,-9],"-68":[-112,20,91],"-43":[75,21,76],"33":
 [...]
 
 -- !sql_arr_json_without_quote_doris --
-0      {1:[1, 0, 0], 0:[0, 1, 0]}      {101:[-38, -115, 35], -59:[-113, -128, 
110], 10:[-78, -127, 16], 56:[108, -40, 124], -22:[-63, -88, -24], 37:[-7, 81, 
-20], 14:[-114, 95, -3], 110:[71, -72, -84], 125:[1, 110, 56], -40:[-13, 19, 
80], 20:[-41, -115, 107], 46:[82, -104, -30], 57:[116, 68, 88], -104:[-64, 119, 
31], -72:[-65, -44, 27], 1:[-127, -73, 81], 74:[81, -82, -32], -99:[-70, 37, 
55], 60:[89, 112, 124], -58:[-69, 50, -56], 102:[27, -17, -9], -68:[-112, 20, 
91], -43:[75, 21, 76], 33:[103, 6 [...]
+0      {1:[1, 0, 0], 0:[0, 1, 0]}      {101:[-38, -115, 35], -59:[-113, -128, 
110], 10:[-78, -127, 16], 56:[108, -40, 124], -22:[-63, -88, -24], 37:[-7, 81, 
-20], 14:[-114, 95, -3], 110:[71, -72, -84], 125:[1, 110, 56], -40:[-13, 19, 
80], 20:[-41, -115, 107], 46:[82, -104, -30], 57:[116, 68, 88], -104:[-64, 119, 
31], -72:[-65, -44, 27], 1:[-127, -73, 81], 74:[81, -82, -32], -99:[-70, 37, 
55], 60:[89, 112, 124], -58:[-69, 50, -56], 102:[27, -17, -9], -68:[-112, 20, 
91], -43:[75, 21, 76], 33:[103, 6 [...]
 
 -- !sql_arr --
 100
diff --git 
a/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.groovy
 
b/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.groovy
new file mode 100644
index 00000000000..68fd6b1f6f1
--- /dev/null
+++ 
b/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_json_insert_into_with_s3.groovy
@@ -0,0 +1,253 @@
+// 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.
+
+
+import com.google.common.collect.Lists
+import org.apache.commons.lang3.StringUtils
+import org.codehaus.groovy.runtime.IOGroovyMethods
+
+suite("test_nestedtypes_json_insert_into_with_s3", "p0") {
+    sql 'use regression_test_datatype_p0_nested_types'
+    sql 'set enable_nereids_planner=false'
+    sql 'set max_allowed_packet=4194304'
+    sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 
'false')"""
+
+    String ak = getS3AK()
+    String sk = getS3SK()
+    String s3_endpoint = getS3Endpoint()
+    String bucket = context.config.otherConfigs.get("s3BucketName");
+
+
+    def dataFilePath = 
"https://"+"${bucket}"+"."+"${s3_endpoint}"+"/regression/datalake";
+
+    ArrayList<String> json_files = ["${dataFilePath}/amory_array_scala.json", 
"${dataFilePath}/amory_arr_arr.json",
+                                           
"${dataFilePath}/amory_map_scala_scala.json","${dataFilePath}/amory_arr_map.json",
+                                            
"${dataFilePath}/amory_map_array.json"]
+
+    List<String> table_names = new ArrayList<>()
+    def nested_table_dup = "tbl_json_array_nested_types_s3"
+    def nested_table_dup2 = "tbl_json_array_nested_types_s32"
+    def nested_table_map_dup = "tbl_json_map_types_s3"
+    def nested_table_array_map_dup = "tbl_json_array_map_types_s3"
+    def nested_table_map_array_dup = "tbl_json_map_array_types_s3"
+    // table_names should same with json_files order
+    table_names.add(nested_table_dup)
+    table_names.add(nested_table_dup2)
+    table_names.add(nested_table_map_dup)
+    table_names.add(nested_table_array_map_dup)
+    table_names.add(nested_table_map_array_dup)
+
+
+    // define dup key table with nested table types with one nested scala
+    sql "DROP TABLE IF EXISTS ${nested_table_dup}"
+    sql """
+        CREATE TABLE IF NOT EXISTS ${nested_table_dup} (
+            `k1` bigint(11) NULL,
+            `c_bool` array<boolean> NULL,
+            `c_tinyint` array<tinyint(4)> NULL,
+            `c_smallint` array<smallint(6)> NULL,
+            `c_int` array<int(11)> NULL,
+            `c_bigint` array<bigint(20)> NULL,
+            `c_largeint` array<largeint(40)> NULL,
+            `c_float` array<float> NULL,
+            `c_double` array<double> NULL,
+            `c_decimal` array<decimal(20, 3)> NULL,
+            `c_decimalv3` array<decimalv3(20, 3)> NULL,
+            `c_date` array<date> NULL,
+            `c_datetime` array<datetime> NULL,
+            `c_datev2` array<datev2> NULL,
+            `c_datetimev2` array<datetimev2(0)> NULL,
+            `c_char` array<char(15)> NULL,
+            `c_varchar` array<varchar(100)> NULL,
+            `c_string` array<text> NULL
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`k1`)
+        COMMENT 'OLAP'
+        DISTRIBUTED BY HASH(`k1`) BUCKETS 10
+        PROPERTIES("replication_num" = "1");
+        """
+    // define dup key table with nested table types with two nested scala
+    sql "DROP TABLE IF EXISTS ${nested_table_dup2}"
+    sql """
+        CREATE TABLE IF NOT EXISTS ${nested_table_dup2} (
+            `k1` bigint(11) NULL,
+            `c_bool` array<array<boolean>> NULL,
+            `c_tinyint` array<array<tinyint(4)>> NULL,
+            `c_smallint` array<array<smallint(6)>> NULL,
+            `c_int` array<array<int(11)>> NULL,
+            `c_bigint` array<array<bigint(20)>> NULL,
+            `c_largeint` array<array<largeint(40)>> NULL,
+            `c_float` array<array<float>> NULL,
+            `c_double` array<array<double>> NULL,
+            `c_decimal` array<array<decimal(20, 3)>> NULL,
+            `c_decimalv3` array<array<decimalv3(20, 3)>> NULL,
+            `c_date` array<array<date>> NULL,
+            `c_datetime` array<array<datetime>> NULL,
+            `c_datev2` array<array<datev2>> NULL,
+            `c_datetimev2` array<array<datetimev2(0)>> NULL,
+            `c_char` array<array<char(15)>> NULL,
+            `c_varchar` array<array<varchar(100)>> NULL,
+            `c_string` array<array<text>> NULL
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`k1`)
+        COMMENT 'OLAP'
+        DISTRIBUTED BY HASH(`k1`) BUCKETS 10
+        PROPERTIES("replication_num" = "1");
+        """
+
+    // define dup key table with map types with one nested scala
+    sql "DROP TABLE IF EXISTS ${nested_table_map_dup}"
+    sql """
+        CREATE TABLE IF NOT EXISTS ${nested_table_map_dup} (
+            `k1` bigint(11) NULL,
+            `c_bool` map<boolean, boolean> NULL,
+            `c_tinyint` map<tinyint(4), tinyint(4)> NULL,
+            `c_smallint` map<smallint(6), smallint(6)> NULL,
+            `c_int` map<int(11), int(11)> NULL,
+            `c_bigint` map<bigint(20), bigint(20)> NULL,
+            `c_largeint` map<largeint(40), largeint(40)> NULL,
+            `c_float` map<float, float> NULL,
+            `c_double` map<double, double> NULL,
+            `c_decimal` map<decimal(20, 3), decimal(20, 3)> NULL,
+            `c_decimalv3` map<decimalv3(20, 3), decimalv3(20, 3)> NULL,
+            `c_date` map<date, date> NULL,
+            `c_datetime` map<datetime, datetime> NULL,
+            `c_datev2` map<datev2, datev2> NULL,
+            `c_datetimev2` map<datetimev2(0), datetimev2(0)> NULL,
+            `c_char` map<char(15), char(15)> NULL,
+            `c_varchar` map<varchar(100), varchar(100)> NULL,
+            `c_string` map<text, text> NULL
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`k1`)
+        COMMENT 'OLAP'
+        DISTRIBUTED BY HASH(`k1`) BUCKETS 10
+        PROPERTIES("replication_num" = "1");
+        """
+
+    // define dup key table with array nested map table types with one nested 
scala
+    sql "DROP TABLE IF EXISTS ${nested_table_array_map_dup}"
+    sql """
+        CREATE TABLE IF NOT EXISTS ${nested_table_array_map_dup} (
+            `k1` bigint(11) NULL,
+            `c_bool` array<map<boolean, boolean>> NULL,
+            `c_tinyint` array<map<tinyint(4), tinyint(4)>> NULL,
+            `c_smallint` array<map<smallint(6), smallint(6)>> NULL,
+            `c_int` array<map<int(11), int(11)>> NULL,
+            `c_bigint` array<map<bigint(20), bigint(20)>> NULL,
+            `c_largeint` array<map<largeint(40), largeint(40)>> NULL,
+            `c_float` array<map<float, float>> NULL,
+            `c_double` array<map<double, double>> NULL,
+            `c_decimal` array<map<decimal(20, 3), decimal(20, 3)>> NULL,
+            `c_decimalv3` array<map<decimalv3(20, 3), decimalv3(20, 3)>> NULL,
+            `c_date` array<map<date, date>> NULL,
+            `c_datetime` array<map<datetime, datetime>> NULL,
+            `c_datev2` array<map<datev2, datev2>> NULL,
+            `c_datetimev2` array<map<datetimev2(0), datetimev2(0)>> NULL,
+            `c_char` array<map<char(15), char(15)>> NULL,
+            `c_varchar` array<map<varchar(100), varchar(100)>> NULL,
+            `c_string` array<map<text, text>> NULL
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`k1`)
+        COMMENT 'OLAP'
+        DISTRIBUTED BY HASH(`k1`) BUCKETS 10
+        PROPERTIES("replication_num" = "1");
+        """
+
+    // define dup key table with map nested value array table types with one 
nested scala
+    sql "DROP TABLE IF EXISTS ${nested_table_map_array_dup}"
+    sql """
+        CREATE TABLE IF NOT EXISTS ${nested_table_map_array_dup} (
+            `k1` bigint(11) NULL,
+            `c_bool` map<boolean, array<boolean>> NULL,
+            `c_tinyint` map<tinyint(4), array<tinyint(4)>> NULL,
+            `c_smallint` map<smallint(6), array<smallint(6)>> NULL,
+            `c_int` map<int(11), array<int(11)>> NULL,
+            `c_bigint` map<bigint(20), array<bigint(20)>> NULL,
+            `c_largeint` map<largeint(40), array<largeint(40)>> NULL,
+            `c_float` map<float, array<float>> NULL,
+            `c_double` map<double, array<double>> NULL,
+            `c_decimal` map<decimal(20, 3), array<decimal(20, 3)>> NULL,
+            `c_decimalv3` map<decimalv3(20, 3), array<decimalv3(20, 3)>> NULL,
+            `c_date` map<date, array<date>> NULL,
+            `c_datetime` map<datetime, array<datetime>> NULL,
+            `c_datev2` map<datev2, array<datev2>> NULL,
+            `c_datetimev2` map<datetimev2(0), array<datetimev2(0)>> NULL,
+            `c_char` map<char(15), array<char(15)>> NULL,
+            `c_varchar` map<varchar(100), array<varchar(100)>> NULL,
+            `c_string` map<text, array<text>> NULL
+        ) ENGINE=OLAP
+        DUPLICATE KEY(`k1`)
+        COMMENT 'OLAP'
+        DISTRIBUTED BY HASH(`k1`) BUCKETS 10
+        PROPERTIES("replication_num" = "1");
+        """
+
+    // step1. select * from s3 with 0-100 items
+    // step2. insert into doris table
+    // step2. query and check
+
+    for (int i = 0; i < 3; ++i) {
+        qt_sql_arr_json_without_quote_s3 """
+        select * from s3("uri" = "${json_files[i]}",
+                "s3.access_key"= "${ak}",
+                "s3.secret_key" = "${sk}",
+                "format" = "json",
+                "read_json_by_line"="true") order by k1 limit 1;
+            """
+
+        sql """
+        insert into ${table_names[i]} select * from s3("uri" = 
"${json_files[i]}",
+                "s3.access_key"= "${ak}",
+                "s3.secret_key" = "${sk}",
+                "format" = "json",
+                "read_json_by_line"="true")
+             """
+
+        qt_sql_arr_json_without_quote_doris """ select * from 
${table_names[i]} order by k1 limit 1; """
+
+    }
+
+
+    // now cast for map can not implicit cast type
+    for (int i = 3; i < json_files.size(); ++i) {
+        qt_sql_arr_json_without_quote_s3 """
+        select * from s3(
+                "uri" = "${json_files[i]}",
+                "s3.access_key"= "${ak}",
+                "s3.secret_key" = "${sk}",
+                "format" = "json",
+                "read_json_by_line"="true") order by k1 limit 1;
+            """
+
+        sql """
+        insert into ${table_names[i]} select * from s3 (
+               "uri" = "${json_files[i]}",
+                "s3.access_key"= "${ak}",
+                "s3.secret_key" = "${sk}",
+                "format" = "json",
+                "read_json_by_line"="true");"""
+
+        qt_sql_arr_json_without_quote_doris """ select * from 
${table_names[i]} order by k1 limit 1; """
+
+    }
+
+    qt_sql_arr """ select array_size(c_tinyint) from 
tbl_json_array_nested_types_s3 order by k1; """
+    qt_sql_arr """ select array_size(c_tinyint) from 
tbl_json_array_nested_types_s32 order by k1; """
+    qt_sql_arr """ select array_size(c_tinyint) from 
tbl_json_array_map_types_s3 order by k1; """
+    qt_sql_map_arr """ select array_size(map_values(c_tinyint)) from 
tbl_json_map_array_types_s3 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