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 2b34a7f90ac [test](case) add test case to improve code coverage #25516
(#26398)
2b34a7f90ac is described below
commit 2b34a7f90ac4f66e387583b21821c3cea6df82bd
Author: zhangstar333 <[email protected]>
AuthorDate: Fri Nov 3 19:05:24 2023 +0800
[test](case) add test case to improve code coverage #25516 (#26398)
---
be/src/runtime/user_function_cache.cpp | 8 ----
.../aggregate_function_combinator.h | 2 -
.../data/delete_p0/fold_constant/fold_constant.out | 45 ++++++++++++++++++++++
.../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/query_p0/aggregate/bitmap_agg.groovy | 3 ++
.../suites/query_p0/aggregate/map_agg.groovy | 4 ++
.../test_select_stddev_variance_window.groovy | 12 ++++++
10 files changed, 129 insertions(+), 10 deletions(-)
diff --git a/be/src/runtime/user_function_cache.cpp
b/be/src/runtime/user_function_cache.cpp
index 39507ec222d..05b2fe0882e 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/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/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 4fc90143464..81075f18b1f 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: [email protected]
For additional commands, e-mail: [email protected]