This is an automated email from the ASF dual-hosted git repository. zhangstar333 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 8f15f9adf68 [test](case) add test case to improve code coverage (#25516) 8f15f9adf68 is described below commit 8f15f9adf68f8dfd459bfc4ed52df91c28cd08d2 Author: zhangstar333 <87313068+zhangstar...@users.noreply.github.com> AuthorDate: Wed Nov 1 12:51:12 2023 +0800 [test](case) add test case to improve code coverage (#25516) [test](case) add test case to improve code coverage (#25516) --- be/src/runtime/user_function_cache.cpp | 8 --- .../aggregate_function_combinator.h | 2 - .../data/delete_p0/fold_constant/fold_constant.out | 45 +++++++++++++++ .../data/pipelineX/test_repeat_operator.out | 66 +++++++++++++++++++++- .../data/query_p0/aggregate/bitmap_agg.out | 7 +++ .../data/query_p0/aggregate/map_agg.out | 7 +++ .../test_select_stddev_variance_window.out | 34 +++++++++++ .../delete_p0/fold_constant/fold_constant.groovy | 17 ++++++ .../suites/pipelineX/test_repeat_operator.groovy | 8 +++ .../suites/query_p0/aggregate/bitmap_agg.groovy | 3 + .../suites/query_p0/aggregate/map_agg.groovy | 4 ++ .../test_select_stddev_variance_window.groovy | 12 ++++ 12 files changed, 202 insertions(+), 11 deletions(-) diff --git a/be/src/runtime/user_function_cache.cpp b/be/src/runtime/user_function_cache.cpp index 9f07ba59029..c2b25971587 100644 --- a/be/src/runtime/user_function_cache.cpp +++ b/be/src/runtime/user_function_cache.cpp @@ -200,14 +200,6 @@ Status UserFunctionCache::_load_cached_lib() { return Status::OK(); } -std::string get_real_symbol(const std::string& symbol) { - static std::regex rx1("8palo_udf"); - std::string str1 = std::regex_replace(symbol, rx1, "9doris_udf"); - static std::regex rx2("4palo"); - std::string str2 = std::regex_replace(str1, rx2, "5doris"); - return str2; -} - Status UserFunctionCache::_get_cache_entry(int64_t fid, const std::string& url, const std::string& checksum, std::shared_ptr<UserFunctionCacheEntry>& output_entry, diff --git a/be/src/vec/aggregate_functions/aggregate_function_combinator.h b/be/src/vec/aggregate_functions/aggregate_function_combinator.h index 9f67df02dbe..1593d74ed4e 100644 --- a/be/src/vec/aggregate_functions/aggregate_function_combinator.h +++ b/be/src/vec/aggregate_functions/aggregate_function_combinator.h @@ -50,8 +50,6 @@ class IAggregateFunctionCombinator { public: virtual String get_name() const = 0; - virtual bool is_for_internal_usage_only() const { return false; } - /** From the arguments for combined function (ex: UInt64, UInt8 for sumIf), * get the arguments for nested function (ex: UInt64 for sum). * If arguments are not suitable for combined function, throw an exception. diff --git a/regression-test/data/delete_p0/fold_constant/fold_constant.out b/regression-test/data/delete_p0/fold_constant/fold_constant.out index 032867a9785..fb082c93b62 100644 --- a/regression-test/data/delete_p0/fold_constant/fold_constant.out +++ b/regression-test/data/delete_p0/fold_constant/fold_constant.out @@ -22,3 +22,48 @@ -- !select -- \N 0.00000 +-- !select_coalesce_bool -- +true + +-- !select_coalesce_tinyint -- +1 + +-- !select_coalesce_smallint -- +1 + +-- !select_coalesce_int -- +1 + +-- !select_coalesce_bigint -- +1 + +-- !select_coalesce_largeint -- +1 + +-- !select_coalesce_float -- +1.0 + +-- !select_coalesce_double -- +1.0 + +-- !select_coalesce_datetime -- +2022-10-17T11:16:50 + +-- !select_coalesce_date -- +2022-10-17 + +-- !select_coalesce_decimal -- +1 + +-- !select_coalesce_decimalv2 -- +1 + +-- !select_abs1 -- +3 + +-- !select_abs2 -- +3.2 + +-- !select_array -- +[1] + diff --git a/regression-test/data/pipelineX/test_repeat_operator.out b/regression-test/data/pipelineX/test_repeat_operator.out index 37416e00429..6e6fc180e80 100644 --- a/regression-test/data/pipelineX/test_repeat_operator.out +++ b/regression-test/data/pipelineX/test_repeat_operator.out @@ -1,4 +1,67 @@ -- This file is automatically generated. You should know what you did if you want to edit this +-- !non_pipeline -- +\N \N +\N 1 +\N 2 +\N 3 +\N 4 +\N 5 +\N 6 +\N 7 +\N 8 +\N 9 +\N 10 +\N 11 +\N 12 +\N 13 +\N 14 +\N 15 +\N 16 +\N 17 +\N 18 +\N 19 +\N 20 +1 \N +1 2 +2 \N +2 13 +3 \N +3 7 +4 \N +4 15 +5 \N +5 10 +6 \N +6 20 +7 \N +7 18 +8 \N +8 12 +9 \N +9 4 +10 \N +10 1 +11 \N +11 17 +12 \N +12 9 +13 \N +13 11 +14 \N +14 5 +15 \N +15 19 +16 \N +16 3 +17 \N +17 14 +18 \N +18 8 +19 \N +19 6 +20 \N +20 16 + -- !pipeline -- \N \N \N 1 @@ -287,4 +350,5 @@ 19 \N \N 19 6 4 20 \N \N -20 16 20 \ No newline at end of file +20 16 20 + diff --git a/regression-test/data/query_p0/aggregate/bitmap_agg.out b/regression-test/data/query_p0/aggregate/bitmap_agg.out index f078fe0f6eb..f1d5ed5a0f2 100644 --- a/regression-test/data/query_p0/aggregate/bitmap_agg.out +++ b/regression-test/data/query_p0/aggregate/bitmap_agg.out @@ -15,3 +15,10 @@ 5 5 5 5 +-- !sql5 -- +5 5 +5 5 +5 5 +5 5 +5 5 + diff --git a/regression-test/data/query_p0/aggregate/map_agg.out b/regression-test/data/query_p0/aggregate/map_agg.out index ef9e6371f1c..afb924f1abd 100644 --- a/regression-test/data/query_p0/aggregate/map_agg.out +++ b/regression-test/data/query_p0/aggregate/map_agg.out @@ -28,6 +28,13 @@ 2 2.4567 3.3300 4.5500 3 188.9980 998.9960 1024.1024 +-- !sql6 -- +\N +\N +V2_3 +V3_3 +V5_3 + -- !garbled_characters -- 001 90.0 92.0 80.0 \N 002 88.0 90.0 75.5 \N diff --git a/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out b/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out index d8542dca566..2fb00519631 100644 --- a/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out +++ b/regression-test/data/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.out @@ -1087,3 +1087,37 @@ 1 1992 true 1 32767 false +-- !sql_row_number2 -- +1 -32767 false +1 255 false +1 1985 true +1 1986 false +1 1989 false +1 1991 false +1 1992 true +1 32767 false + +-- !sql_rank2 -- +1 -32767 false +1 -32767 false +1 255 false +1 1985 true +1 1986 false +1 1989 false +1 1991 false +1 1991 false +1 1992 true +1 32767 false + +-- !sql_dense_rank2 -- +1 -32767 false +1 -32767 false +1 255 false +1 1985 true +1 1986 false +1 1989 false +1 1991 false +1 1991 false +1 1992 true +1 32767 false + diff --git a/regression-test/suites/delete_p0/fold_constant/fold_constant.groovy b/regression-test/suites/delete_p0/fold_constant/fold_constant.groovy index d6aec52ea82..ea36b02166c 100644 --- a/regression-test/suites/delete_p0/fold_constant/fold_constant.groovy +++ b/regression-test/suites/delete_p0/fold_constant/fold_constant.groovy @@ -61,4 +61,21 @@ suite("fold_constant") { qt_select "select * from d_table2 order by 1;" qt_select "select 10.0/0, 0.0/10" + sql """ set enable_fold_constant_by_be = true; """ + sql """ set experimental_enable_nereids_planner = false; """ + qt_select_coalesce_bool "select coalesce(true);" + qt_select_coalesce_tinyint "select coalesce(cast(1 as tinyint));" + qt_select_coalesce_smallint "select coalesce(cast(1 as smallint))" + qt_select_coalesce_int "select coalesce(cast(1 as int));" + qt_select_coalesce_bigint "select coalesce(cast(1 as bigint));" + qt_select_coalesce_largeint "select coalesce(cast(1 as largeint));" + qt_select_coalesce_float "select coalesce(cast(1 as float));" + qt_select_coalesce_double "select coalesce(cast(1 as double));" + qt_select_coalesce_datetime "select coalesce(cast(\"2022:10:17 11:16:50\" as datetime));" + qt_select_coalesce_date "select coalesce(cast(\"2022:10:17 11:16:50\" as date));" + qt_select_coalesce_decimal "select coalesce(cast(1.123 as decimal));" + qt_select_coalesce_decimalv2 "select coalesce(cast(1.123456789 as decimal));" + qt_select_abs1 "select abs(-3);" + qt_select_abs2 "select abs(-3.2);" + qt_select_array "select array(true);" } diff --git a/regression-test/suites/pipelineX/test_repeat_operator.groovy b/regression-test/suites/pipelineX/test_repeat_operator.groovy index 57357b0b4a6..500973db92f 100644 --- a/regression-test/suites/pipelineX/test_repeat_operator.groovy +++ b/regression-test/suites/pipelineX/test_repeat_operator.groovy @@ -54,6 +54,14 @@ suite("test_repeat_operator") { (17, 14, 17), (20, 16, 20); """ + sql"""set enable_pipeline_engine = false; """ + + qt_non_pipeline """ + SELECT k1, k2 + FROM REPEATNODE + GROUP BY GROUPING SETS ((k1, k2), (k2), (k1), ()) + ORDER BY k1, k2; + """ sql"""set enable_pipeline_engine = true; """ diff --git a/regression-test/suites/query_p0/aggregate/bitmap_agg.groovy b/regression-test/suites/query_p0/aggregate/bitmap_agg.groovy index 7ee79c61862..b5a9fe87702 100644 --- a/regression-test/suites/query_p0/aggregate/bitmap_agg.groovy +++ b/regression-test/suites/query_p0/aggregate/bitmap_agg.groovy @@ -118,5 +118,8 @@ suite("bitmap_agg") { qt_sql4 """ select count(`n_nationkey`), bitmap_count(bitmap_agg(`n_nationkey`)) from `test_bitmap_agg_nation` group by `n_regionkey`; """ + qt_sql5 """ + select count(`n_nationkey`), bitmap_count(bitmap_agg(`n_nationkey`)) from `test_bitmap_agg_nation` group by `N_REGIONKEY` order by 1; + """ sql "DROP TABLE IF EXISTS `test_bitmap_agg_nation`;" } diff --git a/regression-test/suites/query_p0/aggregate/map_agg.groovy b/regression-test/suites/query_p0/aggregate/map_agg.groovy index 3eecbc1043b..7ca0c543345 100644 --- a/regression-test/suites/query_p0/aggregate/map_agg.groovy +++ b/regression-test/suites/query_p0/aggregate/map_agg.groovy @@ -268,6 +268,10 @@ suite("map_agg") { ORDER BY `id`; """ + qt_sql6 """ + select m['LC'] from (SELECT `id`, map_agg(`label_name`, `value_field`) m FROM test_map_agg_nullable GROUP BY `id`)t order by 1; + """ + qt_garbled_characters """ select userid, map['语文'] 语文, map['数学'] 数学, map['英语'] 英语, map['政治'] 政治 diff --git a/regression-test/suites/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.groovy b/regression-test/suites/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.groovy index 7ec02d90ae1..155bc3cbab5 100644 --- a/regression-test/suites/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.groovy +++ b/regression-test/suites/query_p0/sql_functions/window_functions/test_select_stddev_variance_window.groovy @@ -171,6 +171,18 @@ suite("test_select_stddev_variance_window") { qt_sql_dense_rank """ select * from (select dense_rank() over(partition by k2 order by k6) as rk,k2,k6 from ${tableName}) as t where rk = 1 order by 1,2,3; """ + + sql "set experimental_enable_pipeline_engine = false;" + + qt_sql_row_number2 """ + select * from (select row_number() over(partition by k2 order by k6) as rk,k2,k6 from ${tableName}) as t where rk = 1 order by 1,2,3; + """ + qt_sql_rank2 """ + select * from (select rank() over(partition by k2 order by k6) as rk,k2,k6 from ${tableName}) as t where rk = 1 order by 1,2,3; + """ + qt_sql_dense_rank2 """ + select * from (select dense_rank() over(partition by k2 order by k6) as rk,k2,k6 from ${tableName}) as t where rk = 1 order by 1,2,3; + """ } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org