From a2d6724fa731e348c04453d103a47d0ecdf2e73a Mon Sep 17 00:00:00 2001 From: Mingyu Chen Date: Fri, 15 Apr 2022 15:17:11 +0800 Subject: [PATCH] [fix] change parameter type of hll_cardinality from STRING to HLL (#9002) In #8882, we disabled the conversion from string to hll. So we need to change the parameter type of hll_cardinality() too --- gensrc/script/doris_builtins_functions.py | 5 +---- regression-test/data/types/complex_types/basic_agg_test.out | 5 +++++ .../suites/types/complex_types/basic_agg_test.groovy | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py index d8d027b521..6dea5780a2 100755 --- a/gensrc/script/doris_builtins_functions.py +++ b/gensrc/script/doris_builtins_functions.py @@ -1175,7 +1175,7 @@ visible_functions = [ '', '', 'vec', ''], #hll function - [['hll_cardinality'], 'BIGINT', ['VARCHAR'], + [['hll_cardinality'], 'BIGINT', ['HLL'], '_ZN5doris12HllFunctions15hll_cardinalityEPN9doris_udf15FunctionContextERKNS1_9StringValE', '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], [['hll_hash'], 'HLL', ['VARCHAR'], @@ -1184,9 +1184,6 @@ visible_functions = [ [['hll_empty'], 'HLL', [], '_ZN5doris12HllFunctions9hll_emptyEPN9doris_udf15FunctionContextE', '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], - [['hll_cardinality'], 'BIGINT', ['STRING'], - '_ZN5doris12HllFunctions15hll_cardinalityEPN9doris_udf15FunctionContextERKNS1_9StringValE', - '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], [['hll_hash'], 'HLL', ['STRING'], '_ZN5doris12HllFunctions8hll_hashEPN9doris_udf15FunctionContextERKNS1_9StringValE', '', '', 'vec', 'ALWAYS_NOT_NULLABLE'], diff --git a/regression-test/data/types/complex_types/basic_agg_test.out b/regression-test/data/types/complex_types/basic_agg_test.out index 057cc0032f..767a1dc038 100644 --- a/regression-test/data/types/complex_types/basic_agg_test.out +++ b/regression-test/data/types/complex_types/basic_agg_test.out @@ -9,3 +9,8 @@ 2 \N 3 \N +-- !sql_hll_cardinality -- +1 0 +2 1 +3 2 + diff --git a/regression-test/suites/types/complex_types/basic_agg_test.groovy b/regression-test/suites/types/complex_types/basic_agg_test.groovy index c7528246e7..6314f76dab 100644 --- a/regression-test/suites/types/complex_types/basic_agg_test.groovy +++ b/regression-test/suites/types/complex_types/basic_agg_test.groovy @@ -27,4 +27,6 @@ suite("basic_agg_test") { qt_sql_bitmap """select * from bitmap_basic_agg;""" qt_sql_hll """select * from hll_basic_agg;""" -} \ No newline at end of file + + qt_sql_hll_cardinality """select k1, hll_cardinality(hll_union(k2)) from hll_basic_agg group by k1 order by k1;""" +}