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
The following commit(s) were added to refs/heads/branch-2.0 by this push: new c43a20fafd5 [Improve](complex type) delete fe config disable_nested_complex_type (#36255) c43a20fafd5 is described below commit c43a20fafd5758909e59d5801ca2986e68a3d403 Author: amory <wangqian...@selectdb.com> AuthorDate: Tue Jun 18 11:15:48 2024 +0800 [Improve](complex type) delete fe config disable_nested_complex_type (#36255) same with https://github.com/apache/doris/pull/36255 --- .../main/java/org/apache/doris/common/Config.java | 11 ---- .../java/org/apache/doris/analysis/TypeDef.java | 11 ---- ...ocal_tvf_with_complex_type_insertinto_doris.out | 3 -- .../two_level_nestedtypes_with_s3data.groovy | 1 - .../suites/datatype_p0/nested_types/load.groovy | 2 +- ...st_nested_types_insert_into_with_literal.groovy | 3 +- .../test_nested_types_insert_into_with_s3.groovy | 1 - ...test_nestedtypes_csv_insert_into_with_s3.groovy | 1 - ...est_nestedtypes_json_insert_into_with_s3.groovy | 1 - ...l_tvf_with_complex_type_insertinto_doris.groovy | 2 +- .../test_load_with_map_nested_array.groovy | 1 - .../aggregate/map_agg_nested_insert_doris.groovy | 2 +- .../show/test_nested_complex_switch.groovy | 58 ---------------------- 13 files changed, 5 insertions(+), 92 deletions(-) diff --git a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java index 99e59c02264..9e401b16588 100644 --- a/fe/fe-common/src/main/java/org/apache/doris/common/Config.java +++ b/fe/fe-common/src/main/java/org/apache/doris/common/Config.java @@ -2084,17 +2084,6 @@ public class Config extends ConfigBase { @ConfField(mutable = true) public static boolean disable_datev1 = true; - /** - * Now we not fully support array/struct/map nesting complex type in many situation, - * so just disable creating nesting complex data type when create table. - * We can make it able after we fully support - */ - @ConfField(mutable = true, masterOnly = true, description = { - "当前默认设置为 true,不支持建表时创建复杂类型(array/struct/map)嵌套复杂类型, 仅支持array类型自身嵌套。", - "Now default set to true, not support create complex type(array/struct/map) nested complex type " - + "when we create table, only support array type nested array"}) - public static boolean disable_nested_complex_type = true; - /* * This variable indicates the number of digits by which to increase the scale * of the result of division operations performed with the `/` operator. The diff --git a/fe/fe-core/src/main/java/org/apache/doris/analysis/TypeDef.java b/fe/fe-core/src/main/java/org/apache/doris/analysis/TypeDef.java index 42745b3cb69..8ae8e5cd898 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/analysis/TypeDef.java +++ b/fe/fe-core/src/main/java/org/apache/doris/analysis/TypeDef.java @@ -28,7 +28,6 @@ import org.apache.doris.catalog.StructField; import org.apache.doris.catalog.StructType; import org.apache.doris.catalog.Type; import org.apache.doris.common.AnalysisException; -import org.apache.doris.common.Config; import org.apache.doris.thrift.TColumnDesc; import org.apache.doris.thrift.TPrimitiveType; @@ -129,18 +128,10 @@ public class TypeDef implements ParseNode { Type itemType = ((ArrayType) type).getItemType(); if (itemType instanceof ScalarType) { analyzeNestedType(type, (ScalarType) itemType); - } else if (Config.disable_nested_complex_type && !(itemType instanceof ArrayType)) { - // now we can array nesting array - throw new AnalysisException("Unsupported data type: ARRAY<" + itemType.toSql() + ">"); } } if (type.isMapType()) { MapType mt = (MapType) type; - if (Config.disable_nested_complex_type && (!(mt.getKeyType() instanceof ScalarType) - || !(mt.getValueType() instanceof ScalarType))) { - throw new AnalysisException("Unsupported data type: MAP<" + mt.getKeyType().toSql() + "," - + mt.getValueType().toSql() + ">"); - } if (mt.getKeyType() instanceof ScalarType) { analyzeNestedType(type, (ScalarType) mt.getKeyType()); } @@ -159,8 +150,6 @@ public class TypeDef implements ParseNode { throw new AnalysisException("Duplicate field name " + field.getName() + " in struct " + type.toSql()); } - } else if (Config.disable_nested_complex_type) { - throw new AnalysisException("Unsupported field type: " + fieldType.toSql() + " for STRUCT"); } } } diff --git a/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out b/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out index ebc6fbe02b8..8e99380d460 100644 --- a/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out +++ b/regression-test/data/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.out @@ -2,9 +2,6 @@ -- !sql -- 0 --- !sql -- -0 - -- !sql -- 2 {1:[0.35815922932906263, 0.0011899152357573994, 0.28749219850167373, 0.93512930168283781, 0.1552584991620739, 0.73308976093672584, 0.52815960653805338, 0.92936404769642733, 0.89084215295591418, 0.21986459138832559], 2:[0.25076205844319044, 0.54003619330849928, 0.70661164863002113, 0.99472899095144263, 0.078314941019622886, 0.44206845606243961, 0.30857433265707379, 0.048661247184825784, 0.76954870938240083, 0.27253204080482074], 3:[0.687619207224633, 0.81614795840545351, 0.8866348164721 [...] diff --git a/regression-test/suites/datatype_p0/nested_types/base_cases/two_level_nestedtypes_with_s3data.groovy b/regression-test/suites/datatype_p0/nested_types/base_cases/two_level_nestedtypes_with_s3data.groovy index ea3f85f098b..bb8cda47df6 100644 --- a/regression-test/suites/datatype_p0/nested_types/base_cases/two_level_nestedtypes_with_s3data.groovy +++ b/regression-test/suites/datatype_p0/nested_types/base_cases/two_level_nestedtypes_with_s3data.groovy @@ -20,7 +20,6 @@ import org.apache.commons.lang3.StringUtils suite("two_level_nestedtypes_with_s3data") { sql """set enable_nereids_planner=false""" sql """ set enable_fallback_to_original_planner=true;""" - sql """ ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false');""" // this test case aim to test one-level nested type with s3 data diff --git a/regression-test/suites/datatype_p0/nested_types/load.groovy b/regression-test/suites/datatype_p0/nested_types/load.groovy index 3ceffc30cd4..2bf559425d1 100644 --- a/regression-test/suites/datatype_p0/nested_types/load.groovy +++ b/regression-test/suites/datatype_p0/nested_types/load.groovy @@ -17,7 +17,7 @@ suite("load") { // ddl begin - sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')""" + sql """set enable_nereids_planner=false""" def dataFile = """test_scalar_types_100.csv""" diff --git a/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_literal.groovy b/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_literal.groovy index 9edb670414f..239fcf1e9cf 100644 --- a/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_literal.groovy +++ b/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_literal.groovy @@ -24,7 +24,8 @@ suite("test_nested_types_insert_into_with_literal", "p0") { sql 'use regression_test_datatype_p0_nested_types' // old planner does not support cast empty sql 'set enable_nereids_planner=false' - sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')""" +// sql 'set enable_nereids_planner=true' +// sql 'set enable_fallback_to_original_planner=false' def table_names = [ "two_level_array_array_a", diff --git a/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_s3.groovy b/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_s3.groovy index 2b59e76aa29..fc2d3d25988 100644 --- a/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_s3.groovy +++ b/regression-test/suites/datatype_p0/nested_types/query/test_nested_types_insert_into_with_s3.groovy @@ -24,7 +24,6 @@ suite("test_nested_types_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() diff --git a/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_csv_insert_into_with_s3.groovy b/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_csv_insert_into_with_s3.groovy index ab9dff9ffb2..40f76575bcf 100644 --- a/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_csv_insert_into_with_s3.groovy +++ b/regression-test/suites/datatype_p0/nested_types/query/test_nestedtypes_csv_insert_into_with_s3.groovy @@ -25,7 +25,6 @@ suite("test_nestedtypes_csv_insert_into_with_s3", "p0") { sql 'set enable_nereids_planner=false' sql 'set max_allowed_packet=4194304' sql 'set topn_opt_limit_threshold=10000' - sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')""" String ak = getS3AK() String sk = getS3SK() 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 index 35d154cbbd0..10a9333a568 100644 --- 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 @@ -25,7 +25,6 @@ suite("test_nestedtypes_json_insert_into_with_s3", "p0") { sql 'set enable_nereids_planner=false' sql 'set max_allowed_packet=4194304' sql 'set topn_opt_limit_threshold=10000' - sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')""" String ak = getS3AK() String sk = getS3SK() diff --git a/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy b/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy index 5d68209b6db..70d9427e1e3 100644 --- a/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy +++ b/regression-test/suites/external_table_p0/tvf/test_local_tvf_with_complex_type_insertinto_doris.groovy @@ -43,7 +43,7 @@ suite("test_local_tvf_with_complex_type_insertinto_doris","external,hive,tvf,ext } } - qt_sql """ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')""" + // create doris table sql """ DROP TABLE IF EXISTS ${table_name} """ diff --git a/regression-test/suites/load_p0/stream_load/test_load_with_map_nested_array.groovy b/regression-test/suites/load_p0/stream_load/test_load_with_map_nested_array.groovy index 7e7e676bf3a..312905bc868 100644 --- a/regression-test/suites/load_p0/stream_load/test_load_with_map_nested_array.groovy +++ b/regression-test/suites/load_p0/stream_load/test_load_with_map_nested_array.groovy @@ -17,7 +17,6 @@ suite("test_load_with_map_nested_array", "p0") { def tableName = "test_load_with_map_nested_array" - sql """ ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false'); """ sql """ DROP TABLE IF EXISTS ${tableName} """ sql """ diff --git a/regression-test/suites/query_p0/aggregate/map_agg_nested_insert_doris.groovy b/regression-test/suites/query_p0/aggregate/map_agg_nested_insert_doris.groovy index dc0de44257e..27d1c449ab3 100644 --- a/regression-test/suites/query_p0/aggregate/map_agg_nested_insert_doris.groovy +++ b/regression-test/suites/query_p0/aggregate/map_agg_nested_insert_doris.groovy @@ -20,7 +20,7 @@ suite("map_agg_nested_insert_doris", "p0") { def tb_doris = "test_map_agg_nested_insert_target" sql "DROP TABLE IF EXISTS `${tb_base}`;" sql "DROP TABLE IF EXISTS `${tb_doris}`;" - sql """ ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false'); """ + sql """ CREATE TABLE `${tb_base}` ( diff --git a/regression-test/suites/query_p0/show/test_nested_complex_switch.groovy b/regression-test/suites/query_p0/show/test_nested_complex_switch.groovy index 5639d52ddb0..206d77ce9c8 100644 --- a/regression-test/suites/query_p0/show/test_nested_complex_switch.groovy +++ b/regression-test/suites/query_p0/show/test_nested_complex_switch.groovy @@ -137,64 +137,6 @@ suite("test_nested_complex_switch", "query") { sql "DROP TABLE IF EXISTS ${testTable_m}" sql "DROP TABLE IF EXISTS ${testTable_a}" sql "DROP TABLE IF EXISTS ${testTable_s}" - sql "ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'true')" - - // map - test { - sql sql_m_s - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported data type: MAP<TEXT,STRUCT<f1:TINYINT>>" - } - - test { - sql sql_m_a - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported data type: MAP<ARRAY<INT>,TEXT>" - } - - test { - sql sql_m_m - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported data type: MAP<TEXT,MAP<TEXT,INT>>" - } - - // array - test { - sql sql_a_s - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported data type: ARRAY<STRUCT<f1:TINYINT>>" - } - - - test { - sql sql_a_m - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported data type: ARRAY<MAP<TEXT,INT>>" - } - - // struct - test { - sql sql_s_s - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported field type: STRUCT<f11:BOOLEAN> for STRUCT" - } - - test { - sql sql_s_a - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported field type: ARRAY<INT> for STRUCT" - } - - test { - sql sql_s_m - exception "java.sql.SQLException: errCode = 2, detailMessage = Unsupported field type: MAP<BOOLEAN,TINYINT> for STRUCT" - } - - } finally { - try_sql("DROP TABLE IF EXISTS ${testTable_m}") - try_sql("DROP TABLE IF EXISTS ${testTable_a}") - try_sql("DROP TABLE IF EXISTS ${testTable_s}") - } - - try { - sql "DROP TABLE IF EXISTS ${testTable_m}" - sql "DROP TABLE IF EXISTS ${testTable_a}" - sql "DROP TABLE IF EXISTS ${testTable_s}" - sql "ADMIN SET FRONTEND CONFIG ('disable_nested_complex_type' = 'false')" - // map test { --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org