You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2022/04/18 11:57:47 UTC

[incubator-doris] 08/17: [fix] change parameter type of hll_cardinality from STRING to HLL (#9002)

This is an automated email from the ASF dual-hosted git repository.

morningman pushed a commit to branch dev-1.0.1
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git

commit 46c3baa90a87c5dd8580f0058772762b7bc17228
Author: Mingyu Chen <mo...@gmail.com>
AuthorDate: Fri Apr 15 15:17:11 2022 +0800

    [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 +++++
 regression-test/suites/types/complex_types/basic_agg_test.groovy | 3 +++
 3 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/gensrc/script/doris_builtins_functions.py b/gensrc/script/doris_builtins_functions.py
index 9d1b602def..8e8797430e 100755
--- a/gensrc/script/doris_builtins_functions.py
+++ b/gensrc/script/doris_builtins_functions.py
@@ -1120,7 +1120,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'],
@@ -1129,9 +1129,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 c489d94905..5b41524948 100644
--- a/regression-test/suites/types/complex_types/basic_agg_test.groovy
+++ b/regression-test/suites/types/complex_types/basic_agg_test.groovy
@@ -26,3 +26,6 @@ for (String table in tables) {
 qt_sql_bitmap """select * from bitmap_basic_agg;"""
 
 qt_sql_hll """select * from hll_basic_agg;"""
+
+qt_sql_hll_cardinality """select k1, hll_cardinality(hll_union(k2)) from hll_basic_agg group by k1 order by k1;"""
+}


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org