This is an automated email from the ASF dual-hosted git repository.
airborne12 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 30d9109fbd7 [chore](regression-test) fix some unstable cases (#62922)
30d9109fbd7 is described below
commit 30d9109fbd7ef11cde0e564f424df2bc886427d3
Author: lihangyu <[email protected]>
AuthorDate: Thu May 7 10:32:25 2026 +0800
[chore](regression-test) fix some unstable cases (#62922)
---
.../test_export_variant_10k_columns.groovy | 0
regression-test/suites/variant_p0/nested.groovy | 188 -------------------
.../suites/variant_p0/nested/load.groovy | 200 ---------------------
.../variant_p0/nested/nested_in_top_array.groovy | 135 --------------
.../suites/variant_p0/nested/sql/q01.sql | 13 --
regression-test/suites/variant_p0/nested2.groovy | 164 -----------------
6 files changed, 700 deletions(-)
diff --git
a/regression-test/suites/export_p0/test_export_variant_10k_columns.groovy
b/regression-test/suites/export_p2/test_export_variant_10k_columns.groovy
similarity index 100%
rename from
regression-test/suites/export_p0/test_export_variant_10k_columns.groovy
rename to
regression-test/suites/export_p2/test_export_variant_10k_columns.groovy
diff --git a/regression-test/suites/variant_p0/nested.groovy
b/regression-test/suites/variant_p0/nested.groovy
deleted file mode 100644
index f3786f608a6..00000000000
--- a/regression-test/suites/variant_p0/nested.groovy
+++ /dev/null
@@ -1,188 +0,0 @@
-// 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("regression_test_variant_nested", "p0"){
- def backendId_to_backendIP = [:]
- def backendId_to_backendHttpPort = [:]
- getBackendIpHttpPort(backendId_to_backendIP, backendId_to_backendHttpPort);
-
- sql "set default_variant_enable_doc_mode = false"
- sql "set default_variant_max_subcolumns_count = 0"
- sql "set default_variant_sparse_hash_shard_count = 0"
- sql "set default_variant_enable_typed_paths_to_sparse = false"
- try {
-
- def table_name = "var_nested"
- sql "DROP TABLE IF EXISTS ${table_name}"
- sql "set enable_variant_flatten_nested = true"
- sql """
- CREATE TABLE IF NOT EXISTS ${table_name} (
- k bigint,
- v variant <properties("variant_max_subcolumns_count" =
"3")>
- )
- DUPLICATE KEY(`k`)
- DISTRIBUTED BY HASH(k) BUCKETS 4
- properties("replication_num" = "1", "disable_auto_compaction"
= "false", "deprecated_variant_enable_flatten_nested" = "true");
- """
- sql """
- insert into var_nested values (1, '{"xx" : 10}');
- insert into var_nested values (2, '{"nested": [{"ba" :
"11111"},{"a" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024, "aaa" :
"11"}, {"xx" : 10}]}');
- insert into var_nested values (3, '{"xx" : 10}');
- insert into var_nested values (4, '{"nested": [{"baaa" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (5, '{"nested": [{"ba" :
"11111"},{"a" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024, "aaa" :
"11"}, {"xx" : 10}]}');
- insert into var_nested values (6, '{"nested": [{"mmm" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (7, '{"nested": [{"ba" :
"11111"},{"a" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024, "aaa" :
"11"}, {"xx" : 10}]}');
- insert into var_nested values (8, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (9, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (10, '{"xx" : 10}');
- insert into var_nested values (11, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (12, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (13, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (14, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (15, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (16, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (17, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (18, '{"xx" : 10}');
- insert into var_nested values (19, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (20, '{"nested": [{"yyy" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- insert into var_nested values (21, '{"nested": [{"ax1111" :
"1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024, "aaa" : "11"}, {"xx" :
10}]}');
- insert into var_nested values (22, '{"nested": [{"axxxb": 100,
"xxxy111": 111}, {"ddsss":1024, "aaa" : "11"}, {"xx" : 10}, {"zzz11" :
"123333"}]}');
- insert into var_nested values (23, '{"nested": [{"yyyxxxx" :
"11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024,
"aaa" : "11"}, {"xx" : 10}]}');
- """
-
- sql """
- insert into var_nested values (24, '{"xx" : 10}');
- insert into var_nested values (25, '{"nested":{"nested": [{"ba" :
"11111"},{"a" : "1111"},{"axxxb": 100, "xxxy111": 111}, {"ddsss":1024, "aaa" :
"11"}, {"xx" : 10}]}}');
- insert into var_nested values (26, '{"xx" : 10}');
- insert into var_nested values (27, '{"nested" : {"nested":
[{"yyyxxxx" : "11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111},
{"ddsss":1024, "aaa" : "11"}, {"xx" : 10}]}}');
- insert into var_nested values (28, '{"nested" : {"nested":
[{"yyyxxxx" : "11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111": 111},
{"ddsss":1024, "aaa" : "11"}, {"xx" : 10}]}, "not nested" : 1024, "not nested2"
: {"llll" : 123}}');
- """
- sql """select * from var_nested limit 1"""
- sql """set describe_extend_variant_column = true"""
- qt_sql """DESC var_nested"""
- qt_sql """
- select * from var_nested order by k limit 101
- """
- for (int i = 101; i < 121; ++i) {
- sql """insert into var_nested values (${i}, '{"nested${i}" :
{"nested": [{"yyyxxxx" : "11111"},{"ax1111" : "1111"},{"axxxb": 100, "xxxy111":
111}, {"ddsss":1024, "aaa" : "11"}, {"xx" : 10}]}, "not nested" : 1024, "not
nested2" : {"llll" : 123}}');"""
- }
-
- trigger_and_wait_compaction("var_nested", "full", 1800)
-
- qt_sql """
- select * from var_nested order by k limit 101
- """
- sql """INSERT INTO var_nested SELECT *, '{"k1":1, "k2": "some", "k3" :
[1234], "k4" : 1.10000, "k5" : [[123]], "nested1" : {"nested2" : [{"a" : 10,
"b" : 1.1, "c" : "1111"}]}}' FROM numbers("number" = "1000") where number > 200
limit 100;"""
- sql """INSERT INTO var_nested SELECT *, '{"k2":1, "k3": "nice", "k4" :
[1234], "k5" : 1.10000, "k6" : [[123]], "nested2" : {"nested1" : [{"a" : 10,
"b" : 1.1, "c" : "1111"}]}}' FROM numbers("number" = "5013") where number >=
400 limit 1024;"""
- trigger_and_wait_compaction("var_nested", "full", 1800)
-
- qt_sql """select
/*+SET_VAR(batch_size=1024,broker_load_batch_size=16352,disable_streaming_preaggregations=true,enable_distinct_streaming_aggregation=true,parallel_fragment_exec_
-parallel_pipeline_task_num=7,profile_level=1,enable_pipeline_engine=true,enable_parallel_scan=false,parallel_scan_max_scanners_count=16
-,parallel_scan_min_rows_per_scanner=128,enable_fold_constant_by_be=false,enable_rewrite_element_at_to_slot=true,runtime_filter_type=2,enable_parallel_result_sink=true,sort_phase_num=0,enable_nereids_planner=true,rewrite_or_to_in_predicate_threshold=2,enable_function_pushdown=true,enable_common_expr_pushdown=false,enable_local_exchange=true,partition_pruning_expand_threshold=10,enable_share_hash_table_for_broadcast_join=false,enable_two_phase_read_opt=true,enable_common_expr_pushdown_for_
[...]
- qt_sql """select * from var_nested where v['k2'] = 'some' and
array_contains(cast(v['nested1']['nested2']['a'] as array<tinyint>), 10) order
by k limit 1;"""
-
- sql """INSERT INTO var_nested SELECT *, '{"k1":1, "k2": "some", "k3" :
[1234], "k4" : 1.10000, "k5" : [[123]], "nested1" : {"nested2" : [{"a" : 10,
"b" : 1.1, "c" : "1111"}]}}' FROM numbers("number" = "4096") where number >
1024 limit 1024;"""
- sql """INSERT INTO var_nested SELECT *, '{"k1":1, "k2": "what", "k3" :
[1234], "k4" : 1.10000, "k5" : [[123]], "nested1" : {"nested2" : [{"a" : 10,
"b" : 1.1, "c" : "1111"}]}}' FROM numbers("number" = "4096") where number >
2048 limit 1024;"""
- sql """INSERT INTO var_nested SELECT *, '{"k1":1, "k2": "about", "k3"
: [1234], "k4" : 1.10000, "k5" : [[123]], "nested1" : {"nested2" : [{"a" : 10,
"b" : 1.1, "c" : "1111"}]}}' FROM numbers("number" = "4096") where number >
3072 limit 1024;"""
- sql """INSERT INTO var_nested SELECT *, '{"k1":1, "k2": "nested", "k3"
: [1234], "k4" : 1.10000, "k5" : [[123]], "nested1" : {"nested2" : [{"a" : 10,
"b" : 1.1, "c" : "1111"}]}}' FROM numbers("number" = "6000") where number >
4096 limit 1024;"""
- qt_sql """select * from var_nested where v['k2'] = 'what' order by k
limit 10"""
- qt_sql """select * from var_nested where v['k2'] = 'some' and
array_contains(cast(v['nested1']['nested2']['a'] as array<tinyint>), 10) order
by k limit 1;"""
-
- // type change case
- sql """INSERT INTO var_nested SELECT *, '{"k1":"1", "k2": 1.1, "k3" :
[1234.0], "k4" : 1.10000, "k5" : [["123"]], "nested1" : {"nested2" : [{"a" :
"10", "b" : "1.1", "c" : 1111.111}]}}' FROM numbers("number" = "8000") where
number > 7000 limit 100;"""
- qt_sql """select * from var_nested where v['k2'] = 'what' and
array_contains(cast(v['nested1']['nested2']['a'] as array<tinyint>), 10) order
by k limit 1;"""
- trigger_and_wait_compaction("var_nested", "full", 1800)
- qt_sql """select * from var_nested where v['k2'] = 'nested' and
array_contains(cast(v['nested1']['nested2']['a'] as array<tinyint>), 10) order
by k limit 1;"""
- sql """select * from var_nested where v['k2'] = 'some' or v['k3'] =
'nice' limit 100;"""
-
- // insert into select
- sql "DROP TABLE IF EXISTS var_nested2"
- sql """
- CREATE TABLE IF NOT EXISTS var_nested2 (
- k bigint,
- v variant <properties("variant_max_subcolumns_count" =
"3")>
- )
- UNIQUE KEY(`k`)
- DISTRIBUTED BY HASH(k) BUCKETS 1
- properties("replication_num" = "1", "disable_auto_compaction"
= "false", "enable_unique_key_merge_on_write" = "true",
"deprecated_variant_enable_flatten_nested" = "true");
- """
- sql """insert into var_nested2 select * from var_nested order by k
limit 1024"""
- qt_sql """select
/*+SET_VAR(batch_size=4064,broker_load_batch_size=16352,disable_streaming_preaggregations=true,enable_distinct_streaming_aggregation=true,parallel_pipeline_task_num=1,profile_level=1,enable_parallel_scan=true,parallel_scan_max_scanners_count=48,parallel_scan_min_rows_per_scanner=16384,enable_fold_constant_by_be=true,enable_rewrite_element_at_to_slot=true,runtime_filter_type=12,enable_parallel_result_sink=false,enable_nereids_planner=true,rewrite_or_to_in_predica
[...]
- qt_sql """select v['nested'] from var_nested2 where k < 10 order by k
limit 10;"""
- // 0. nomal explode variant array
- order_qt_explode_sql """select count(),cast(vv['xx'] as int) from
var_nested lateral view explode_variant_array(v['nested']) tmp as vv where
vv['xx'] = 10 group by cast(vv['xx'] as int)"""
- sql """truncate table var_nested2"""
- sql """insert into var_nested2 values(1119111,
'{"eventId":1,"firstName":"Name1","lastName":"Surname1","body":{"phoneNumbers":[{"number":"5550219210","type":"GSM","callLimit":5},{"number":"02124713252","type":"HOME","callLimit":3},{"number":"05550219211","callLimit":2,"type":"WORK"}]}}
-')"""
- order_qt_explode_sql """select v['eventId'], phone_numbers from
var_nested2 lateral view explode_variant_array(v['body']['phoneNumbers']) tmp1
as phone_numbers
-where phone_numbers['type'] = 'GSM' OR phone_numbers['type'] = 'HOME' and
phone_numbers['callLimit'] > 2;"""
-
- // test array_function
- sql "DROP TABLE IF EXISTS var_nested_array_agg"
- sql """
- CREATE TABLE IF NOT EXISTS var_nested_array_agg(
- k bigint,
- v variant <properties("variant_max_subcolumns_count" =
"3")>
- )
- UNIQUE KEY(`k`)
- DISTRIBUTED BY HASH(k) BUCKETS 1
- properties("replication_num" = "1", "disable_auto_compaction"
= "false", "enable_unique_key_merge_on_write" = "true",
"deprecated_variant_enable_flatten_nested" = "true");
- """
- sql "insert into var_nested_array_agg select * from var_nested"
- // 1. array_contains
- qt_sql "select * from var_nested_array_agg where
array_contains(cast(v['nested']['xx'] as array<int>), 10) order by k limit 10"
- // 2. array_agg scalar
- sql "select k, array_agg(cast(v['nested'] as text)) from
var_nested_array_agg group by k limit 10"
-
- // test explode_variant_array with abonomal case
- sql "DROP TABLE IF EXISTS var_nested_explode_variant_with_abnomal"
- sql """
- CREATE TABLE IF NOT EXISTS
var_nested_explode_variant_with_abnomal(
- k bigint,
- v variant <properties("variant_max_subcolumns_count" =
"3")>
- )
- UNIQUE KEY(`k`)
- DISTRIBUTED BY HASH(k) BUCKETS 1
- properties("replication_num" = "1", "disable_auto_compaction"
= "false", "enable_unique_key_merge_on_write" = "true",
"deprecated_variant_enable_flatten_nested" = "true");
- """
- sql "insert into var_nested_explode_variant_with_abnomal select * from
var_nested"
- // 1. v['nested']['x'] is null root
- order_qt_explode_sql """select count(),cast(vv as int) from
var_nested_explode_variant_with_abnomal lateral view
explode_variant_array(v['nested']['x']) tmp as vv where vv = 10 group by
cast(vv as int)"""
- // 2. v['nested']['xx'] is normal array
- order_qt_explode_sql """select count(),cast(vv as int) from
var_nested_explode_variant_with_abnomal lateral view
explode_variant_array(v['nested']['xx']) tmp as vv where vv = 10 group by
cast(vv as int)"""
- // 3. v['xx'] is none array scalar type
- test {
- sql """select count(),cast(vv as int) from
var_nested_explode_variant_with_abnomal lateral view
explode_variant_array(v['xx']) tmp as vv where vv = 10 group by cast(vv as
int)"""
- exception("explode not support none array type")
- }
- // 4. v['k1'] is json scalar type
- test {
- sql """select count(),cast(vv as int) from
var_nested_explode_variant_with_abnomal lateral view
explode_variant_array(v['k1']) tmp as vv where vv = 10 group by cast(vv as
int)"""
- exception("explode not support none array type")
- }
- // 5. toplevel nested array
- sql "truncate table var_nested_explode_variant_with_abnomal"
- sql """insert into var_nested_explode_variant_with_abnomal values(1,
'[{"a" : 10}, {"b" : "20", "c" :1024, "a" : 11}]')"""
- sql """insert into var_nested_explode_variant_with_abnomal values(2,
'[{"a" : 10}, {"b" : "20", "a" : 150}]')"""
- order_qt_explode_sql """select count(),cast(vv as int) from
var_nested_explode_variant_with_abnomal lateral view
explode_variant_array(v['a']) tmp as vv where vv = 10 group by cast(vv as
int)"""
- // FIXME after refator
- // order_qt_explode_sql """select count(),cast(vv as int) from
var_nested_explode_variant_with_abnomal lateral view explode_variant_array(v)
tmp as vv where vv['a'] = 10 group by cast(vv as int)"""
- } finally {
- // reset flags
- }
-
-}
diff --git a/regression-test/suites/variant_p0/nested/load.groovy
b/regression-test/suites/variant_p0/nested/load.groovy
deleted file mode 100644
index ee193fab61b..00000000000
--- a/regression-test/suites/variant_p0/nested/load.groovy
+++ /dev/null
@@ -1,200 +0,0 @@
-// 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.
-
-// // this test is used to test the load of nested array
-// TODO(lihangyu): need to be fixed
-// suite("variant_nested_type_load", "p0"){
-//
-// try {
-//
-// // create a table with conflict variant which insert same nested
subcolumn and scalar subcolumn data
-// def table_name = "var_nested_load_conflict"
-// sql "DROP TABLE IF EXISTS ${table_name}"
-// sql """set describe_extend_variant_column = true"""
-//
-// // set disable_variant_flatten_nested = true to disable variant
flatten nested which is default behavior
-// sql """ set disable_variant_flatten_nested = true """
-// test {
-// sql """
-// CREATE TABLE IF NOT EXISTS ${table_name} (
-// k bigint,
-// v variant
-// )
-// DUPLICATE KEY(`k`)
-// DISTRIBUTED BY HASH(k) BUCKETS 1 -- 1 bucket make
really compaction in conflict case
-// properties("replication_num" = "1",
"disable_auto_compaction" = "true", "deprecated_variant_enable_flatten_nested"
= "true");
-// """
-// exception "If you want to enable variant flatten nested, please
set session variable"
-// }
-//
-//
-// // set disable_variant_flatten_nested = false to enable variant
flatten nested
-// sql """ set disable_variant_flatten_nested = false """
-// sql """
-// CREATE TABLE IF NOT EXISTS ${table_name} (
-// k bigint,
-// v variant
-// )
-// DUPLICATE KEY(`k`)
-// DISTRIBUTED BY HASH(k) BUCKETS 1 -- 1 bucket make
really compaction in conflict case
-// properties("replication_num" = "1",
"disable_auto_compaction" = "true", "deprecated_variant_enable_flatten_nested"
= "true");
-// """
-// sql """ insert into ${table_name} values (1, '{"nested": [{"a": 1,
"c": 1.1}, {"b": "1"}]}'); """
-//
-// def desc_table = { tn ->
-// sql """ set describe_extend_variant_column = true """
-// sql """ select * from ${tn} order by k """
-// qt_sql_desc """ desc ${tn} """
-// }
-//
-// def sql_select_batch = { tn ->
-// qt_sql_0 """select * from ${tn} order by k"""
-//
-// qt_sql_1 """select v['nested']['a'] from ${tn} order by k"""
-// qt_sql_2 """select v['nested']['b'] from ${tn} order by k"""
-// qt_sql_3 """select v['nested']['c'] from ${tn} order by k"""
-//
-// qt_sql_4 """select v['nested'] from ${tn} order by k"""
-// }
-//
-// def sql_test_cast_to_array = { tn ->
-// // test cast to array<int>
-// qt_sql_8 """select cast(v['nested']['a'] as array<int>),
size(cast(v['nested']['a'] as array<int>)) from ${tn} order by k"""
-// qt_sql_9 """select cast(v['nested']['b'] as array<int>),
size(cast(v['nested']['b'] as array<int>)) from ${tn} order by k"""
-// qt_sql_10 """select cast(v['nested']['c'] as array<int>),
size(cast(v['nested']['c'] as array<int>)) from ${tn} order by k"""
-//
-// // test cast to array<string>
-// qt_sql_11 """select cast(v['nested']['a'] as array<string>),
size(cast(v['nested']['a'] as array<string>)) from ${tn} order by k"""
-// qt_sql_12 """select cast(v['nested']['b'] as array<string>),
size(cast(v['nested']['b'] as array<string>)) from ${tn} order by k"""
-// qt_sql_13 """select cast(v['nested']['c'] as array<string>),
size(cast(v['nested']['c'] as array<string>)) from ${tn} order by k"""
-//
-// // test cast to array<double>
-// qt_sql_14 """select cast(v['nested']['a'] as array<double>),
size(cast(v['nested']['a'] as array<double>)) from ${tn} order by k"""
-// qt_sql_15 """select cast(v['nested']['b'] as array<double>),
size(cast(v['nested']['b'] as array<double>)) from ${tn} order by k"""
-// qt_sql_16 """select cast(v['nested']['c'] as array<double>),
size(cast(v['nested']['c'] as array<double>)) from ${tn} order by k"""
-//
-// }
-//
-// def sql_test_cast_to_scalar = { tn ->
-// qt_sql_17 """select cast(v['nested']['a'] as int),
cast(v['nested']['b'] as int), cast(v['nested']['c'] as int) from ${tn} order
by k"""
-// qt_sql_18 """select cast(v['nested']['a'] as string),
cast(v['nested']['b'] as string), cast(v['nested']['c'] as string) from ${tn}
order by k"""
-// qt_sql_19 """select cast(v['nested']['a'] as double),
cast(v['nested']['b'] as double), cast(v['nested']['c'] as double) from ${tn}
order by k"""
-// }
-//
-// /// insert a array of object for a, b, c
-// // insert structure conflict in one row
-// // a , b, c is Nested array,
-// def table_name_1 = "var_nested_load_no_conflict"
-// sql "DROP TABLE IF EXISTS ${table_name_1}"
-// sql """set describe_extend_variant_column = true"""
-// sql """
-// CREATE TABLE IF NOT EXISTS ${table_name_1} (
-// k bigint,
-// v variant
-// )
-// DUPLICATE KEY(`k`)
-// DISTRIBUTED BY HASH(k) BUCKETS 1 -- 1 bucket make really
compaction in conflict case
-// properties("replication_num" = "1",
"disable_auto_compaction" = "true", "deprecated_variant_enable_flatten_nested"
= "true");
-// """
-// // insert a array of object for a, b, c first then insert structure
conflict in one row
-// // insert structure conflict in one row
-// // a , b, c is Nested array,
-// sql """
-// insert into ${table_name_1} values (1, '{"nested": [{"a": 1,
"c": 1.1}, {"b": "1"}]}');
-// """
-// sql_select_batch(table_name_1)
-// sql_test_cast_to_array(table_name_1)
-// sql_test_cast_to_scalar(table_name_1)
-// // insert structure conflict in one row
-// test {
-// sql """
-// insert into ${table_name_1} values (2, '{"nested": {"a":
2.5, "b": "123.1"}}');
-// """
-// exception "Ambiguous paths"
-// }
-// // insert more different combination data for a, b, c
-// sql """
-// insert into ${table_name_1} values (3, '{"nested": [{"a": 2.5,
"b": "123.1"}]}');
-// """
-// sql """
-// insert into ${table_name_1} values (4, '{"nested": [{"a": 2.5,
"b": 123.1}]}');
-// """
-// sql """
-// insert into ${table_name_1} values (5, '{"nested": [{"a": 2.5,
"c": "123.1"}, {"b": "123.1"}]}');
-// """
-// sql """
-// insert into ${table_name_1} values (6, '{"nested": [{"a": 2.5},
{"b": 123.1}]}');
-// """
-// sql """
-// insert into ${table_name_1} values (7, '{"nested": [{"a": 2.5},
{"c": 123.1}, {"b": "123.1"}]}');
-// """
-// sql_select_batch(table_name_1)
-// sql_test_cast_to_array(table_name_1)
-// sql_test_cast_to_scalar(table_name_1)
-// // trigger and wait compaction
-// trigger_and_wait_compaction("${table_name_1}", "full", 1800)
-// sql_select_batch(table_name_1)
-// sql_test_cast_to_array(table_name_1)
-// sql_test_cast_to_scalar(table_name_1)
-//
-// // drop table
-// sql """ drop table ${table_name_1} """
-// sql """ create table ${table_name_1} (k bigint, v variant)
duplicate key(k) distributed by hash(k) buckets 1 properties("replication_num"
= "1", "disable_auto_compaction" = "true",
"deprecated_variant_enable_flatten_nested" = "true") """
-// // insert scalar data first then insert structure conflict in one
row
-// sql """
-// insert into ${table_name_1} values (1, '{"nested": {"a": 2.5,
"b": "123.1"}}');
-// """
-// sql_select_batch(table_name_1)
-// sql_test_cast_to_array(table_name_1)
-// sql_test_cast_to_scalar(table_name_1)
-// // insert structure conflict in one row: a array of object for a,
b, c
-// test {
-// sql """
-// insert into ${table_name_1} values (2, '{"nested": [{"a":
2.5, "b": "123.1"}]}');
-// """
-// exception "Ambiguous paths"
-// }
-// // insert more different combination data for a, b, c in scalar
-// sql """
-// insert into ${table_name_1} values (3, '{"nested": {"a": 2.5,
"b": 123.1}}');
-// """
-// sql """
-// insert into ${table_name_1} values (4, '{"nested": {"a": 2.5,
"c": "123.1"}}');
-// """
-// sql """
-// insert into ${table_name_1} values (5, '{"nested": {"a": 2.5,
"c": 123.1}}');
-// """
-// sql """
-// insert into ${table_name_1} values (6, '{"nested": {"a": 2.5,
"c": "123.1"}}');
-// """
-// sql """
-// insert into ${table_name_1} values (7, '{"nested": {"a": 2.5,
"b": "123.1", "c": 123.1}}');
-// """
-// sql_select_batch(table_name_1)
-// sql_test_cast_to_array(table_name_1)
-// sql_test_cast_to_scalar(table_name_1)
-// // trigger and wait compaction
-// trigger_and_wait_compaction("${table_name_1}", "full", 1800)
-// sql_select_batch(table_name_1)
-// sql_test_cast_to_array(table_name_1)
-// sql_test_cast_to_scalar(table_name_1)
-//
-// } finally {
-// }
-//
-// }
-//
\ No newline at end of file
diff --git
a/regression-test/suites/variant_p0/nested/nested_in_top_array.groovy
b/regression-test/suites/variant_p0/nested/nested_in_top_array.groovy
deleted file mode 100644
index 9c75f20dcb5..00000000000
--- a/regression-test/suites/variant_p0/nested/nested_in_top_array.groovy
+++ /dev/null
@@ -1,135 +0,0 @@
-// 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.
-
-// this test is used to test the nested in top array
-suite("nested_in_top_array", "p0"){
-
- sql "set default_variant_enable_doc_mode = false"
- sql "set default_variant_max_subcolumns_count = 0"
- sql "set default_variant_sparse_hash_shard_count = 0"
- sql "set default_variant_enable_typed_paths_to_sparse = false"
- try {
-
- // create a table with nested in top array
- def table_name = "var_nested_in_top_array"
- sql "DROP TABLE IF EXISTS ${table_name}"
- sql """set describe_extend_variant_column = true"""
-
- sql """ set default_variant_max_subcolumns_count = 0"""
- // set disable_variant_flatten_nested = false to enable variant
flatten nested
- sql """ set enable_variant_flatten_nested = true """
- sql """
- CREATE TABLE IF NOT EXISTS ${table_name} (
- k bigint,
- v variant
- )
- DUPLICATE KEY(`k`)
- DISTRIBUTED BY HASH(k) BUCKETS 1 -- 1 bucket make really
compaction in conflict case
- properties("replication_num" = "1",
"disable_auto_compaction" = "false", "deprecated_variant_enable_flatten_nested"
= "true");
- """
- sql """ insert into ${table_name} values (1, '[{"a": 1, "c": 1.1},
{"b": "1"}]'); """
-
- def sql_select_batch = { tn ->
- qt_sql_0 """select * from ${tn} order by k"""
-
- qt_sql_1 """select v['a'] from ${tn} order by k"""
- qt_sql_2 """select v['b'] from ${tn} order by k"""
- qt_sql_3 """select v['c'] from ${tn} order by k"""
-
- qt_sql_4 """select v from ${tn} order by k"""
- }
-
- def sql_test_cast_to_array = { tn ->
- // test cast to array<int>
- qt_sql_8 """select cast(v['a'] as array<int>), size(cast(v['a'] as
array<int>)) from ${tn} order by k"""
- qt_sql_9 """select cast(v['b'] as array<int>), size(cast(v['b'] as
array<int>)) from ${tn} order by k"""
- qt_sql_10 """select cast(v['c'] as array<int>), size(cast(v['c']
as array<int>)) from ${tn} order by k"""
-
- // test cast to array<string>
- qt_sql_11 """select cast(v['a'] as array<string>),
size(cast(v['a'] as array<string>)) from ${tn} order by k"""
- qt_sql_12 """select cast(v['b'] as array<string>),
size(cast(v['b'] as array<string>)) from ${tn} order by k"""
- qt_sql_13 """select cast(v['c'] as array<string>),
size(cast(v['c'] as array<string>)) from ${tn} order by k"""
-
- // test cast to array<double>
- qt_sql_14 """select cast(v['a'] as array<double>),
size(cast(v['a'] as array<double>)) from ${tn} order by k"""
- qt_sql_15 """select cast(v['b'] as array<double>),
size(cast(v['b'] as array<double>)) from ${tn} order by k"""
- qt_sql_16 """select cast(v['c'] as array<double>),
size(cast(v['c'] as array<double>)) from ${tn} order by k"""
-
- }
-
- def sql_test_cast_to_scalar = { tn ->
- qt_sql_17 """select cast(v['a'] as int), cast(v['b'] as int),
cast(v['c'] as int) from ${tn} order by k"""
- qt_sql_18 """select cast(v['a'] as string), cast(v['b'] as
string), cast(v['c'] as string) from ${tn} order by k"""
- qt_sql_19 """select cast(v['a'] as double), cast(v['b'] as
double), cast(v['c'] as double) from ${tn} order by k"""
- }
-
-
- sql_select_batch(table_name)
- sql_test_cast_to_array(table_name)
- sql_test_cast_to_scalar(table_name)
-
- // insert with type conflict for a, b
- sql """
- insert into ${table_name} values (2, '[{"a": "2.5", "b": 123.1}]');
- """
- sql_select_batch(table_name)
- sql_test_cast_to_array(table_name)
- sql_test_cast_to_scalar(table_name)
-
- // insert with structure conflict for a
- sql """
- insert into ${table_name} values (3, '[{"a": {"c": 1}}, {"a":
{"b": 2}}]');
- """
- sql_select_batch(table_name)
- sql_test_cast_to_array(table_name)
- sql_test_cast_to_scalar(table_name)
-
- // insert ambiguous structure for a which should throw exception
- test {
- sql """
- insert into ${table_name} values (4, '[{"a": {"c": 1}}, {"a":
2}]');
- """
- exception "Ambiguous structure of top_array nested subcolumns:"
- }
-
-
- // insert multi object in array
- sql """
- insert into ${table_name} values (5, '[{"a": {"c": 1}}, {"c":
{"a": 2}}, {"b": "1"}]');
- """
- sql_select_batch(table_name)
- sql_test_cast_to_array(table_name)
- sql_test_cast_to_scalar(table_name)
-
- // insert multi b in array
- sql """
- insert into ${table_name} values (6, '[{"a": 1, "b": 1}, {"b": 2},
{"b": 3}]');
- """
- sql_select_batch(table_name)
- sql_test_cast_to_array(table_name)
- sql_test_cast_to_scalar(table_name)
-
- // trigger and wait compaction
- trigger_and_wait_compaction("${table_name}", "full", 1800)
- sql_select_batch(table_name)
- sql_test_cast_to_array(table_name)
- sql_test_cast_to_scalar(table_name)
-
- } finally {
- }
-
-}
diff --git a/regression-test/suites/variant_p0/nested/sql/q01.sql
b/regression-test/suites/variant_p0/nested/sql/q01.sql
deleted file mode 100644
index 71ee81428ed..00000000000
--- a/regression-test/suites/variant_p0/nested/sql/q01.sql
+++ /dev/null
@@ -1,13 +0,0 @@
--- TABLES: var_nested_load_conflict
-select v['nested']['a'] from var_nested_load_conflict order by k;
-select v['nested']['b'] from var_nested_load_conflict order by k;
-select v['nested']['c'] from var_nested_load_conflict order by k;
-select v['nested'] from var_nested_load_conflict order by k;
-
-select cast(v['nested']['a'] as array<int>), size(cast(v['nested']['a'] as
array<int>)) from var_nested_load_conflict order by k;
-select cast(v['nested']['b'] as array<int>), size(cast(v['nested']['b'] as
array<int>)) from var_nested_load_conflict order by k;
-select cast(v['nested']['c'] as array<int>), size(cast(v['nested']['c'] as
array<int>)) from var_nested_load_conflict order by k;
-
-select cast(v['nested']['a'] as array<string>), size(cast(v['nested']['a'] as
array<string>)) from var_nested_load_conflict order by k;
-select cast(v['nested']['b'] as array<string>), size(cast(v['nested']['b'] as
array<string>)) from var_nested_load_conflict order by k;
-select cast(v['nested']['c'] as array<string>), size(cast(v['nested']['c'] as
array<string>)) from var_nested_load_conflict order by k;
\ No newline at end of file
diff --git a/regression-test/suites/variant_p0/nested2.groovy
b/regression-test/suites/variant_p0/nested2.groovy
deleted file mode 100644
index e1b9d492887..00000000000
--- a/regression-test/suites/variant_p0/nested2.groovy
+++ /dev/null
@@ -1,164 +0,0 @@
-// 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.
-
-// this test is used to test the type conflict of nested array
-suite("variant_nested_type_conflict", "p0"){
-
- // sql "set default_variant_enable_doc_mode = false"
- // sql "set default_variant_max_subcolumns_count = 0"
- // sql "set default_variant_sparse_hash_shard_count = 0"
- // sql "set default_variant_enable_typed_paths_to_sparse = false"
- // try {
-
- // def table_name = "var_nested_type_conflict"
- // sql "DROP TABLE IF EXISTS ${table_name}"
- // sql """set describe_extend_variant_column = true"""
-
- // sql """ set enable_variant_flatten_nested = true """
- // sql "set default_variant_max_subcolumns_count = 0"
- // sql """
- // CREATE TABLE IF NOT EXISTS ${table_name} (
- // k bigint,
- // v variant
- // )
- // DUPLICATE KEY(`k`)
- // DISTRIBUTED BY HASH(k) BUCKETS 1 -- 1 bucket make really
compaction in conflict case
- // properties("replication_num" = "1",
"disable_auto_compaction" = "false", "deprecated_variant_enable_flatten_nested"
= "true");
- // """
- // def sql_select_batch = {
- // qt_sql_0 """select * from ${table_name} order by k"""
-
- // qt_sql_1 """select v['nested']['a'] from ${table_name} order by
k"""
- // qt_sql_2 """select v['nested']['b'] from ${table_name} order by
k"""
- // qt_sql_3 """select v['nested']['c'] from ${table_name} order by
k"""
-
- // qt_sql_4 """select v['nested'] from ${table_name} order by k"""
- // }
-
- // def sql_test_cast_to_array = {
- // // test cast to array<int>
- // qt_sql_8 """select cast(v['nested']['a'] as array<int>),
size(cast(v['nested']['a'] as array<int>)) from ${table_name} order by k"""
- // qt_sql_9 """select cast(v['nested']['b'] as array<int>),
size(cast(v['nested']['b'] as array<int>)) from ${table_name} order by k"""
- // qt_sql_10 """select cast(v['nested']['c'] as array<int>),
size(cast(v['nested']['c'] as array<int>)) from ${table_name} order by k"""
-
- // // test cast to array<string>
- // qt_sql_11 """select cast(v['nested']['a'] as array<string>),
size(cast(v['nested']['a'] as array<string>)) from ${table_name} order by k"""
- // qt_sql_12 """select cast(v['nested']['b'] as array<string>),
size(cast(v['nested']['b'] as array<string>)) from ${table_name} order by k"""
- // qt_sql_13 """select cast(v['nested']['c'] as array<string>),
size(cast(v['nested']['c'] as array<string>)) from ${table_name} order by k"""
-
- // // test cast to array<double>
- // qt_sql_14 """select cast(v['nested']['a'] as array<double>),
size(cast(v['nested']['a'] as array<double>)) from ${table_name} order by k"""
- // qt_sql_15 """select cast(v['nested']['b'] as array<double>),
size(cast(v['nested']['b'] as array<double>)) from ${table_name} order by k"""
- // qt_sql_16 """select cast(v['nested']['c'] as array<double>),
size(cast(v['nested']['c'] as array<double>)) from ${table_name} order by k"""
-
- // }
- // // insert Nested array in Nested array which is not supported
- // test {
- // sql """
- // insert into ${table_name} values (1, '{"nested": [{"a":
[1,2,3]}]}');
- // """
- // exception "Nesting of array in Nested array within variant
subcolumns is currently not supported."
- // }
- // // insert batch different structure in same path
- // test {
- // sql """
- // insert into ${table_name} values (3, '{"nested": [{"a":
2.5, "b": "123.1"}]}'), (4, '{"nested": {"a": 2.5, "b": "123.1"}}');
- // """
- // exception "Ambiguous paths"
- // }
- // /// insert a array of object for a, b, c
- // // insert type conflict in multiple rows
- // sql """
- // insert into ${table_name} values (1, '{"nested": [{"a": 1, "c":
1.1}, {"b": "1"}]}');
- // """
-
- // // for cloud we should select first and then desc for syncing
rowset to get latest schema
- // sql """
- // select * from ${table_name} order by k limit 1;
- // """
- // qt_sql_desc_1 """
- // desc ${table_name};
- // """
- // // now select for a, b, c
- // sql_select_batch()
- // sql_test_cast_to_array()
- // /// insert a, b type changed to double
- // sql """
- // insert into ${table_name} values (2, '{"nested": [{"a": 2.5,
"b": 123.1}]}');
- // """
- // // for cloud we should select first and then desc for syncing
rowset to get latest schema
- // sql """
- // select * from ${table_name} order by k limit 1;
- // """
- // qt_sql_desc_2 """
- // desc ${table_name};
- // """
- // // now select for a, b, c
- // sql_select_batch()
- // sql_test_cast_to_array()
-
- // // trigger and wait compaction
- // trigger_and_wait_compaction("${table_name}", "full", 1800)
-
- // // now select for a, b, c
- // sql_select_batch()
- // sql_test_cast_to_array()
-
- // sql """ truncate table ${table_name} """
-
-
- // // insert type conflict in one row
- // sql """
- // insert into ${table_name} values (1, '{"nested": [{"a": 1, "b":
1.1}, {"a": "1", "b": "1", "c": "1"}]}');
- // """
- // // for cloud we should select first and then desc for syncing
rowset to get latest schema
- // sql """
- // select * from ${table_name} order by k limit 1;
- // """
- // qt_sql_desc_4 """
- // desc ${table_name};
- // """
- // // now select for a, b, c
- // sql_select_batch()
- // sql_test_cast_to_array()
-
- // // insert c type changed to double
- // sql """
- // insert into ${table_name} values (2, '{"nested": [{"a": 1, "c":
1.1}]}');
- // """
- // // for cloud we should select first and then desc for syncing
rowset to get latest schema
- // sql """
- // select * from ${table_name} order by k limit 1;
- // """
- // qt_sql_desc_5 """
- // desc ${table_name};
- // """
- // // now select for a, b, c
- // sql_select_batch()
- // sql_test_cast_to_array()
-
- // // trigger and wait compaction
- // trigger_and_wait_compaction("${table_name}", "full", 1800)
-
- // // now select for a, b, c
- // sql_select_batch()
- // sql_test_cast_to_array()
-
- // } finally {
- // }
-
-}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]