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

morrysnow 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 4c57c31c5c3 [fix](Nereids) count should not accept complex and json 
type (#25354)
4c57c31c5c3 is described below

commit 4c57c31c5c33b1ed8d8c3fd73eb335e59b584128
Author: morrySnow <101034200+morrys...@users.noreply.github.com>
AuthorDate: Mon Oct 16 11:08:35 2023 +0800

    [fix](Nereids) count should not accept complex and json type (#25354)
---
 .../main/java/org/apache/doris/catalog/Type.java   |   5 +
 .../trees/expressions/functions/agg/Count.java     |   9 +-
 .../data/nereids_function_p0/agg_function/agg.out  | 346 ++++++++++-----------
 .../nereids_function_p0/agg_function/agg.groovy    |   2 +
 4 files changed, 184 insertions(+), 178 deletions(-)

diff --git a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java 
b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
index 831ea3724a0..ad498773d47 100644
--- a/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
+++ b/fe/fe-common/src/main/java/org/apache/doris/catalog/Type.java
@@ -446,6 +446,11 @@ public abstract class Type {
         return isObjectStored() || isComplexType() || isJsonbType() || 
isVariantType();
     }
 
+    public static final String OnlyObjectTypeErrorMsg =
+            "Doris hll, bitmap column must use with specific function, and 
don't"
+                    + " support filter, group by or order by. please run 'help 
hll' or 'help bitmap'"
+                    + " in your mysql client.";
+
     public static final String OnlyMetricTypeErrorMsg =
             "Doris hll, bitmap, array, map, struct, jsonb, variant column must 
use with specific function, and don't"
                     + " support filter, group by or order by. please run 'help 
hll' or 'help bitmap' or 'help array'"
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Count.java
 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Count.java
index a9fe3a688be..0f15aac55ac 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Count.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/nereids/trees/expressions/functions/agg/Count.java
@@ -66,7 +66,7 @@ public class Count extends AggregateFunction
 
     public boolean isCountStar() {
         return isStar
-                || children.size() == 0
+                || children.isEmpty()
                 || (children.size() == 1 && child(0) instanceof Literal);
     }
 
@@ -82,8 +82,11 @@ public class Count extends AggregateFunction
     public void checkLegalityAfterRewrite() {
         // after rewrite, count(distinct bitmap_column) should be rewritten to 
bitmap_union_count(bitmap_column)
         for (Expression argument : getArguments()) {
-            if (argument.getDataType().isOnlyMetricType()) {
-                throw new AnalysisException(Type.OnlyMetricTypeErrorMsg);
+            if (argument.getDataType().isObjectType()) {
+                throw new AnalysisException(Type.OnlyObjectTypeErrorMsg);
+            }
+            if (distinct && argument.getDataType().isComplexType()) {
+                throw new AnalysisException("COUNT DISTINCT could not process 
complex type " + this.toSql());
             }
         }
     }
diff --git a/regression-test/data/nereids_function_p0/agg_function/agg.out 
b/regression-test/data/nereids_function_p0/agg_function/agg.out
index 91e473ced01..8474651326b 100644
--- a/regression-test/data/nereids_function_p0/agg_function/agg.out
+++ b/regression-test/data/nereids_function_p0/agg_function/agg.out
@@ -265,7 +265,7 @@
 
 -- !sql_avg_Double_gb --
 \N
-0.4000000000000001
+0.39999999999999997
 1.0
 
 -- !sql_avg_Double --
@@ -291,7 +291,7 @@
 
 -- !sql_avg_Double_agg_phase_3 --
 0      \N
-7      0.39999999999999997
+7      0.4
 5      1.0
 
 -- !sql_avg_Double_agg_phase_4 --
@@ -299,7 +299,7 @@
 
 -- !sql_avg_Double_gb_notnull --
 0.39999999999999997
-1.0000000000000002
+1.0
 
 -- !sql_avg_Double_notnull --
 0.65
@@ -397,11 +397,11 @@
 
 -- !sql_avg_weighted_TinyInt_Double_gb --
 \N
-4.999999999999999
+5.0
 10.2
 
 -- !sql_avg_weighted_TinyInt_Double --
-8.333333333333334
+8.333333333333332
 
 -- !sql_avg_weighted_TinyInt_Double_agg_phase_1 --
 0      \N
@@ -423,15 +423,15 @@
 
 -- !sql_avg_weighted_TinyInt_Double_agg_phase_3 --
 0      \N
-7      4.999999999999999
+7      5.0
 5      10.2
 
 -- !sql_avg_weighted_TinyInt_Double_agg_phase_4 --
-12     8.333333333333332
+12     8.333333333333334
 
 -- !sql_avg_weighted_TinyInt_Double_gb_notnull --
-4.999999999999999
-10.2
+5.0
+10.200000000000001
 
 -- !sql_avg_weighted_TinyInt_Double_notnull --
 8.333333333333334
@@ -451,7 +451,7 @@
 1      12.0
 
 -- !sql_avg_weighted_TinyInt_Double_agg_phase_2_notnull --
-12     8.333333333333334
+12     8.333333333333332
 
 -- !sql_avg_weighted_TinyInt_Double_agg_phase_3_notnull --
 0      \N
@@ -459,11 +459,11 @@
 5      10.2
 
 -- !sql_avg_weighted_TinyInt_Double_agg_phase_4_notnull --
-12     8.333333333333334
+12     8.333333333333332
 
 -- !sql_avg_weighted_SmallInt_Double_gb --
 \N
-5.0
+4.999999999999999
 10.2
 
 -- !sql_avg_weighted_SmallInt_Double --
@@ -496,11 +496,11 @@
 12     8.333333333333334
 
 -- !sql_avg_weighted_SmallInt_Double_gb_notnull --
-4.999999999999999
+5.0
 10.2
 
 -- !sql_avg_weighted_SmallInt_Double_notnull --
-8.333333333333332
+8.333333333333334
 
 -- !sql_avg_weighted_SmallInt_Double_agg_phase_1_notnull --
 1      1.0
@@ -517,11 +517,11 @@
 1      12.0
 
 -- !sql_avg_weighted_SmallInt_Double_agg_phase_2_notnull --
-12     8.333333333333334
+12     8.333333333333332
 
 -- !sql_avg_weighted_SmallInt_Double_agg_phase_3_notnull --
 0      \N
-7      4.999999999999998
+7      5.0
 5      10.2
 
 -- !sql_avg_weighted_SmallInt_Double_agg_phase_4_notnull --
@@ -529,8 +529,8 @@
 
 -- !sql_avg_weighted_Integer_Double_gb --
 \N
-5.0
-10.200000000000001
+4.999999999999999
+10.2
 
 -- !sql_avg_weighted_Integer_Double --
 8.333333333333332
@@ -551,7 +551,7 @@
 1      12.0
 
 -- !sql_avg_weighted_Integer_Double_agg_phase_2 --
-12     8.333333333333332
+12     8.333333333333334
 
 -- !sql_avg_weighted_Integer_Double_agg_phase_3 --
 0      \N
@@ -559,14 +559,14 @@
 5      10.2
 
 -- !sql_avg_weighted_Integer_Double_agg_phase_4 --
-12     8.333333333333332
+12     8.333333333333334
 
 -- !sql_avg_weighted_Integer_Double_gb_notnull --
 4.999999999999999
 10.2
 
 -- !sql_avg_weighted_Integer_Double_notnull --
-8.333333333333334
+8.333333333333332
 
 -- !sql_avg_weighted_Integer_Double_agg_phase_1_notnull --
 1      1.0
@@ -587,19 +587,19 @@
 
 -- !sql_avg_weighted_Integer_Double_agg_phase_3_notnull --
 0      \N
-7      4.999999999999999
-5      10.2
+7      5.0
+5      10.199999999999998
 
 -- !sql_avg_weighted_Integer_Double_agg_phase_4_notnull --
-12     8.333333333333334
+12     8.333333333333332
 
 -- !sql_avg_weighted_BigInt_Double_gb --
 \N
-5.0
-10.200000000000001
+4.999999999999999
+10.2
 
 -- !sql_avg_weighted_BigInt_Double --
-8.333333333333334
+8.333333333333332
 
 -- !sql_avg_weighted_BigInt_Double_agg_phase_1 --
 0      \N
@@ -625,10 +625,10 @@
 5      10.2
 
 -- !sql_avg_weighted_BigInt_Double_agg_phase_4 --
-12     8.333333333333332
+12     8.333333333333334
 
 -- !sql_avg_weighted_BigInt_Double_gb_notnull --
-5.0
+5.000000000000001
 10.2
 
 -- !sql_avg_weighted_BigInt_Double_notnull --
@@ -653,11 +653,11 @@
 
 -- !sql_avg_weighted_BigInt_Double_agg_phase_3_notnull --
 0      \N
-7      5.0
+7      4.999999999999999
 5      10.2
 
 -- !sql_avg_weighted_BigInt_Double_agg_phase_4_notnull --
-12     8.333333333333332
+12     8.333333333333334
 
 -- !sql_avg_weighted_Float_Double_gb --
 \N
@@ -665,7 +665,7 @@
 1.0200000143051147
 
 -- !sql_avg_weighted_Float_Double --
-0.8333333441271231
+0.833333344127123
 
 -- !sql_avg_weighted_Float_Double_agg_phase_1 --
 0      \N
@@ -683,22 +683,22 @@
 1      1.2000000476837158
 
 -- !sql_avg_weighted_Float_Double_agg_phase_2 --
-12     0.833333344127123
+12     0.8333333441271231
 
 -- !sql_avg_weighted_Float_Double_agg_phase_3 --
 0      \N
-7      0.5000000045235666
+7      0.5000000045235667
 5      1.0200000143051147
 
 -- !sql_avg_weighted_Float_Double_agg_phase_4 --
-12     0.8333333441271231
+12     0.8333333441271233
 
 -- !sql_avg_weighted_Float_Double_gb_notnull --
 0.5000000045235666
 1.0200000143051147
 
 -- !sql_avg_weighted_Float_Double_notnull --
-0.833333344127123
+0.8333333441271233
 
 -- !sql_avg_weighted_Float_Double_agg_phase_1_notnull --
 1      0.10000000149011612
@@ -720,10 +720,10 @@
 -- !sql_avg_weighted_Float_Double_agg_phase_3_notnull --
 0      \N
 7      0.5000000045235667
-5      1.0200000143051144
+5      1.0200000143051147
 
 -- !sql_avg_weighted_Float_Double_agg_phase_4_notnull --
-12     0.8333333441271231
+12     0.833333344127123
 
 -- !sql_avg_weighted_Double_Double_gb --
 \N
@@ -753,18 +753,18 @@
 
 -- !sql_avg_weighted_Double_Double_agg_phase_3 --
 0      \N
-7      0.5
-5      1.02
+7      0.5000000000000001
+5      1.0199999999999998
 
 -- !sql_avg_weighted_Double_Double_agg_phase_4 --
-12     0.8333333333333334
+12     0.8333333333333333
 
 -- !sql_avg_weighted_Double_Double_gb_notnull --
-0.5000000000000001
-1.02
+0.5
+1.0199999999999998
 
 -- !sql_avg_weighted_Double_Double_notnull --
-0.8333333333333334
+0.8333333333333335
 
 -- !sql_avg_weighted_Double_Double_agg_phase_1_notnull --
 1      0.10000000000000002
@@ -785,19 +785,19 @@
 
 -- !sql_avg_weighted_Double_Double_agg_phase_3_notnull --
 0      \N
-7      0.49999999999999983
+7      0.49999999999999994
 5      1.02
 
 -- !sql_avg_weighted_Double_Double_agg_phase_4_notnull --
-12     0.8333333333333333
+12     0.8333333333333335
 
 -- !sql_avg_weighted_DecimalV2_Double_gb --
 \N
-0.5
+0.5000000000000001
 1.02
 
 -- !sql_avg_weighted_DecimalV2_Double --
-0.8333333333333333
+0.8333333333333334
 
 -- !sql_avg_weighted_DecimalV2_Double_agg_phase_1 --
 0      \N
@@ -815,18 +815,18 @@
 1      1.2
 
 -- !sql_avg_weighted_DecimalV2_Double_agg_phase_2 --
-12     0.8333333333333334
+12     0.8333333333333335
 
 -- !sql_avg_weighted_DecimalV2_Double_agg_phase_3 --
 0      \N
-7      0.49999999999999994
+7      0.5000000000000001
 5      1.02
 
 -- !sql_avg_weighted_DecimalV2_Double_agg_phase_4 --
-12     0.8333333333333333
+12     0.8333333333333334
 
 -- !sql_avg_weighted_DecimalV2_Double_gb_notnull --
-0.49999999999999994
+0.5
 1.02
 
 -- !sql_avg_weighted_DecimalV2_Double_notnull --
@@ -851,7 +851,7 @@
 
 -- !sql_avg_weighted_DecimalV2_Double_agg_phase_3_notnull --
 0      \N
-7      0.5
+7      0.5000000000000001
 5      1.02
 
 -- !sql_avg_weighted_DecimalV2_Double_agg_phase_4_notnull --
@@ -1319,6 +1319,11 @@
 -- !sql_count_agg_phase_4_notnull --
 12     13
 
+-- !sql_count_array_gb --
+0
+7
+5
+
 -- !sql_count_AnyData_gb --
 0
 7
@@ -1385,15 +1390,6 @@
 -- !sql_count_AnyData_agg_phase_4_notnull --
 12     12
 
--- !sql_count_by_enum_string --
-[{"cbe":{"null":1},"notnull":1,"null":0,"all":1}]
-[{"cbe":{"string2":2,"string1":3,"string3":2},"notnull":7,"null":0,"all":7}]
-[{"cbe":{"string2":2,"string1":1,"string3":2},"notnull":5,"null":0,"all":5}]
-
--- !sql_count_by_enum_string_notnull --
-[{"cbe":{"string1":3,"string2":2,"string3":2},"notnull":7,"null":0,"all":7}]
-[{"cbe":{"string1":1,"string2":2,"string3":2},"notnull":5,"null":0,"all":5}]
-
 -- !sql_group_bit_and_TinyInt_gb --
 \N
 0
@@ -3289,7 +3285,7 @@ true
 1.4142135623730951
 
 -- !sql_stddev_TinyInt --
-3.452052529534664
+3.452052529534663
 
 -- !sql_stddev_TinyInt_agg_phase_1 --
 0      \N
@@ -3355,7 +3351,7 @@ true
 1.4142135623730951
 
 -- !sql_stddev_SmallInt --
-3.452052529534664
+3.452052529534663
 
 -- !sql_stddev_SmallInt_agg_phase_1 --
 0      \N
@@ -3417,11 +3413,11 @@ true
 
 -- !sql_stddev_Integer_gb --
 \N
-2.0
-1.4142135623730951
+1.9999999999999998
+1.414213562373095
 
 -- !sql_stddev_Integer --
-3.452052529534663
+3.452052529534664
 
 -- !sql_stddev_Integer_agg_phase_1 --
 0      \N
@@ -3443,14 +3439,14 @@ true
 
 -- !sql_stddev_Integer_agg_phase_3 --
 0      \N
-7      2.0
+7      1.9999999999999998
 5      1.4142135623730951
 
 -- !sql_stddev_Integer_agg_phase_4 --
 12     3.452052529534663
 
 -- !sql_stddev_Integer_gb_notnull --
-1.9999999999999998
+2.0
 1.4142135623730951
 
 -- !sql_stddev_Integer_notnull --
@@ -3483,7 +3479,7 @@ true
 
 -- !sql_stddev_BigInt_gb --
 \N
-1.9999999999999998
+2.0
 1.4142135623730951
 
 -- !sql_stddev_BigInt --
@@ -3516,7 +3512,7 @@ true
 12     3.452052529534663
 
 -- !sql_stddev_BigInt_gb_notnull --
-1.9999999999999998
+2.0
 1.4142135623730951
 
 -- !sql_stddev_BigInt_notnull --
@@ -3541,7 +3537,7 @@ true
 
 -- !sql_stddev_BigInt_agg_phase_3_notnull --
 0      \N
-7      1.9999999999999998
+7      2.0
 5      1.4142135623730951
 
 -- !sql_stddev_BigInt_agg_phase_4_notnull --
@@ -3553,7 +3549,7 @@ true
 0.1414213730960499
 
 -- !sql_stddev_Float --
-0.34520525854707257
+0.3452052585470726
 
 -- !sql_stddev_Float_agg_phase_1 --
 0      \N
@@ -3579,14 +3575,14 @@ true
 5      0.1414213730960499
 
 -- !sql_stddev_Float_agg_phase_4 --
-12     0.34520525854707257
+12     0.3452052585470726
 
 -- !sql_stddev_Float_gb_notnull --
 0.1999999992549422
 0.1414213730960499
 
 -- !sql_stddev_Float_notnull --
-0.34520525854707257
+0.3452052585470726
 
 -- !sql_stddev_Float_agg_phase_1_notnull --
 1      0.0
@@ -3611,7 +3607,7 @@ true
 5      0.1414213730960499
 
 -- !sql_stddev_Float_agg_phase_4_notnull --
-12     0.3452052585470726
+12     0.34520525854707257
 
 -- !sql_stddev_Double_gb --
 \N
@@ -3637,18 +3633,18 @@ true
 1      0.0
 
 -- !sql_stddev_Double_agg_phase_2 --
-12     0.3452052529534663
+12     0.34520525295346627
 
 -- !sql_stddev_Double_agg_phase_3 --
 0      \N
-7      0.19999999999999998
+7      0.19999999999999996
 5      0.1414213562373095
 
 -- !sql_stddev_Double_agg_phase_4 --
 12     0.3452052529534663
 
 -- !sql_stddev_Double_gb_notnull --
-0.19999999999999996
+0.19999999999999998
 0.1414213562373095
 
 -- !sql_stddev_Double_notnull --
@@ -3669,11 +3665,11 @@ true
 1      0.0
 
 -- !sql_stddev_Double_agg_phase_2_notnull --
-12     0.3452052529534663
+12     0.34520525295346627
 
 -- !sql_stddev_Double_agg_phase_3_notnull --
 0      \N
-7      0.19999999999999998
+7      0.19999999999999996
 5      0.1414213562373095
 
 -- !sql_stddev_Double_agg_phase_4_notnull --
@@ -3700,7 +3696,7 @@ true
 1      0.0
 
 -- !sql_stddev_DecimalV2_agg_phase_2 --
-12     0.3452052529534663
+12     0.34520525295346627
 
 -- !sql_stddev_DecimalV2_agg_phase_3 --
 0      \N
@@ -3729,19 +3725,19 @@ true
 1      0.0
 
 -- !sql_stddev_DecimalV2_agg_phase_2_notnull --
-12     0.3452052529534663
+12     0.34520525295346627
 
 -- !sql_stddev_DecimalV2_agg_phase_3_notnull --
 0      \N
 7      0.19999999999999998
-5      0.14142135623730945
+5      0.1414213562373095
 
 -- !sql_stddev_DecimalV2_agg_phase_4_notnull --
 12     0.3452052529534663
 
 -- !sql_stddev_samp_TinyInt_gb --
 \N
-2.160246899469287
+2.1602468994692865
 1.5811388300841898
 
 -- !sql_stddev_samp_TinyInt --
@@ -3774,7 +3770,7 @@ true
 12     3.605551275463989
 
 -- !sql_stddev_samp_TinyInt_gb_notnull --
-2.160246899469287
+2.1602468994692865
 1.5811388300841898
 
 -- !sql_stddev_samp_TinyInt_notnull --
@@ -3811,7 +3807,7 @@ true
 1.5811388300841898
 
 -- !sql_stddev_samp_SmallInt --
-3.6055512754639896
+3.605551275463989
 
 -- !sql_stddev_samp_SmallInt_agg_phase_1 --
 0      \N
@@ -3873,7 +3869,7 @@ true
 
 -- !sql_stddev_samp_Integer_gb --
 \N
-2.160246899469287
+2.1602468994692865
 1.5811388300841898
 
 -- !sql_stddev_samp_Integer --
@@ -3899,8 +3895,8 @@ true
 
 -- !sql_stddev_samp_Integer_agg_phase_3 --
 0      \N
-7      2.1602468994692865
-5      1.5811388300841893
+7      2.160246899469287
+5      1.5811388300841898
 
 -- !sql_stddev_samp_Integer_agg_phase_4 --
 12     3.605551275463989
@@ -3931,7 +3927,7 @@ true
 
 -- !sql_stddev_samp_Integer_agg_phase_3_notnull --
 0      \N
-7      2.160246899469287
+7      2.1602468994692865
 5      1.5811388300841898
 
 -- !sql_stddev_samp_Integer_agg_phase_4_notnull --
@@ -3939,8 +3935,8 @@ true
 
 -- !sql_stddev_samp_BigInt_gb --
 \N
-2.160246899469287
-1.5811388300841898
+2.1602468994692865
+1.5811388300841893
 
 -- !sql_stddev_samp_BigInt --
 3.605551275463989
@@ -3966,17 +3962,17 @@ true
 -- !sql_stddev_samp_BigInt_agg_phase_3 --
 0      \N
 7      2.160246899469287
-5      1.5811388300841898
+5      1.58113883008419
 
 -- !sql_stddev_samp_BigInt_agg_phase_4 --
 12     3.605551275463989
 
 -- !sql_stddev_samp_BigInt_gb_notnull --
-2.1602468994692865
+2.160246899469287
 1.5811388300841898
 
 -- !sql_stddev_samp_BigInt_notnull --
-3.6055512754639896
+3.605551275463989
 
 -- !sql_stddev_samp_BigInt_agg_phase_1_notnull --
 1      \N
@@ -4042,7 +4038,7 @@ true
 0.15811390185706375
 
 -- !sql_stddev_samp_Float_notnull --
-0.36055513338873013
+0.3605551333887302
 
 -- !sql_stddev_samp_Float_agg_phase_1_notnull --
 1      \N
@@ -4067,11 +4063,11 @@ true
 5      0.15811390185706375
 
 -- !sql_stddev_samp_Float_agg_phase_4_notnull --
-12     0.36055513338873013
+12     0.3605551333887302
 
 -- !sql_stddev_samp_Double_gb --
 \N
-0.21602468994692864
+0.21602468994692867
 0.15811388300841897
 
 -- !sql_stddev_samp_Double --
@@ -4097,14 +4093,14 @@ true
 
 -- !sql_stddev_samp_Double_agg_phase_3 --
 0      \N
-7      0.21602468994692864
+7      0.21602468994692867
 5      0.15811388300841894
 
 -- !sql_stddev_samp_Double_agg_phase_4 --
 12     0.36055512754639896
 
 -- !sql_stddev_samp_Double_gb_notnull --
-0.21602468994692867
+0.21602468994692864
 0.15811388300841897
 
 -- !sql_stddev_samp_Double_notnull --
@@ -4129,11 +4125,11 @@ true
 
 -- !sql_stddev_samp_Double_agg_phase_3_notnull --
 0      \N
-7      0.21602468994692867
+7      0.21602468994692864
 5      0.15811388300841894
 
 -- !sql_stddev_samp_Double_agg_phase_4_notnull --
-12     0.3605551275463989
+12     0.36055512754639896
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_1 --
 0      \N
@@ -4151,11 +4147,11 @@ true
 1      \N
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_2 --
-12     0.3605551275463989
+12     0.36055512754639896
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_3 --
 0      \N
-7      0.21602468994692867
+7      0.21602468994692864
 5      0.15811388300841897
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_4 --
@@ -4176,11 +4172,11 @@ true
 1      \N
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_2_notnull --
-12     0.36055512754639896
+12     0.3605551275463989
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_3_notnull --
 0      \N
-7      0.21602468994692867
+7      0.21602468994692864
 5      0.15811388300841894
 
 -- !sql_stddev_samp_DecimalV2_agg_phase_4_notnull --
@@ -4471,7 +4467,7 @@ true
 -- !sql_sum_Double_gb --
 \N
 2.8
-5.000000000000001
+5.0
 
 -- !sql_sum_Double --
 7.8
@@ -4496,14 +4492,14 @@ true
 
 -- !sql_sum_Double_agg_phase_3 --
 0      \N
-7      2.8000000000000007
+7      2.8
 5      5.0
 
 -- !sql_sum_Double_agg_phase_4 --
 12     7.8
 
 -- !sql_sum_Double_gb_notnull --
-2.8
+2.8000000000000003
 5.0
 
 -- !sql_sum_Double_notnull --
@@ -4524,7 +4520,7 @@ true
 1      1.2
 
 -- !sql_sum_Double_agg_phase_2_notnull --
-12     7.8
+12     7.800000000000001
 
 -- !sql_sum_Double_agg_phase_3_notnull --
 0      \N
@@ -4933,7 +4929,7 @@ true
 -- !sql_variance_TinyInt_gb --
 \N
 3.9999999999999996
-2.0
+2.0000000000000004
 
 -- !sql_variance_TinyInt --
 11.916666666666666
@@ -4991,7 +4987,7 @@ true
 -- !sql_variance_TinyInt_agg_phase_3_notnull --
 0      \N
 7      4.0
-5      2.000000000000001
+5      2.0
 
 -- !sql_variance_TinyInt_agg_phase_4_notnull --
 12     11.916666666666666
@@ -4999,7 +4995,7 @@ true
 -- !sql_variance_SmallInt_gb --
 \N
 3.9999999999999996
-2.0000000000000004
+2.0
 
 -- !sql_variance_SmallInt --
 11.916666666666666
@@ -5024,7 +5020,7 @@ true
 
 -- !sql_variance_SmallInt_agg_phase_3 --
 0      \N
-7      3.999999999999999
+7      3.9999999999999996
 5      2.0
 
 -- !sql_variance_SmallInt_agg_phase_4 --
@@ -5032,7 +5028,7 @@ true
 
 -- !sql_variance_SmallInt_gb_notnull --
 4.0
-2.0000000000000004
+2.0
 
 -- !sql_variance_SmallInt_notnull --
 11.91666666666667
@@ -5057,7 +5053,7 @@ true
 -- !sql_variance_SmallInt_agg_phase_3_notnull --
 0      \N
 7      3.9999999999999996
-5      1.9999999999999993
+5      2.0
 
 -- !sql_variance_SmallInt_agg_phase_4_notnull --
 12     11.916666666666666
@@ -5065,7 +5061,7 @@ true
 -- !sql_variance_Integer_gb --
 \N
 4.0
-2.0
+2.0000000000000004
 
 -- !sql_variance_Integer --
 11.916666666666666
@@ -5091,7 +5087,7 @@ true
 -- !sql_variance_Integer_agg_phase_3 --
 0      \N
 7      4.0
-5      2.0
+5      2.000000000000001
 
 -- !sql_variance_Integer_agg_phase_4 --
 12     11.916666666666666
@@ -5122,15 +5118,15 @@ true
 
 -- !sql_variance_Integer_agg_phase_3_notnull --
 0      \N
-7      3.9999999999999996
-5      2.0000000000000004
+7      4.0
+5      2.0
 
 -- !sql_variance_Integer_agg_phase_4_notnull --
 12     11.916666666666666
 
 -- !sql_variance_BigInt_gb --
 \N
-3.9999999999999996
+4.0
 2.0
 
 -- !sql_variance_BigInt --
@@ -5156,14 +5152,14 @@ true
 
 -- !sql_variance_BigInt_agg_phase_3 --
 0      \N
-7      4.0
+7      4.000000000000001
 5      2.0
 
 -- !sql_variance_BigInt_agg_phase_4 --
 12     11.916666666666666
 
 -- !sql_variance_BigInt_gb_notnull --
-4.0
+3.9999999999999996
 2.0
 
 -- !sql_variance_BigInt_notnull --
@@ -5188,7 +5184,7 @@ true
 
 -- !sql_variance_BigInt_agg_phase_3_notnull --
 0      \N
-7      3.999999999999999
+7      4.0
 5      2.0
 
 -- !sql_variance_BigInt_agg_phase_4_notnull --
@@ -5196,7 +5192,7 @@ true
 
 -- !sql_variance_Float_gb --
 \N
-0.03999999970197689
+0.039999999701976874
 0.020000004768372152
 
 -- !sql_variance_Float --
@@ -5223,7 +5219,7 @@ true
 -- !sql_variance_Float_agg_phase_3 --
 0      \N
 7      0.03999999970197688
-5      0.020000004768372145
+5      0.020000004768372152
 
 -- !sql_variance_Float_agg_phase_4 --
 12     0.11916667052855125
@@ -5254,15 +5250,15 @@ true
 
 -- !sql_variance_Float_agg_phase_3_notnull --
 0      \N
-7      0.03999999970197688
+7      0.039999999701976874
 5      0.020000004768372152
 
 -- !sql_variance_Float_agg_phase_4_notnull --
-12     0.11916667052855125
+12     0.11916667052855123
 
 -- !sql_variance_Double_gb --
 \N
-0.03999999999999999
+0.039999999999999994
 0.019999999999999997
 
 -- !sql_variance_Double --
@@ -5284,22 +5280,22 @@ true
 1      0.0
 
 -- !sql_variance_Double_agg_phase_2 --
-12     0.11916666666666664
+12     0.11916666666666666
 
 -- !sql_variance_Double_agg_phase_3 --
 0      \N
-7      0.039999999999999994
-5      0.02
+7      0.03999999999999999
+5      0.019999999999999993
 
 -- !sql_variance_Double_agg_phase_4 --
-12     0.11916666666666668
+12     0.11916666666666666
 
 -- !sql_variance_Double_gb_notnull --
-0.03999999999999999
+0.039999999999999994
 0.019999999999999997
 
 -- !sql_variance_Double_notnull --
-0.11916666666666668
+0.1191666666666667
 
 -- !sql_variance_Double_agg_phase_1_notnull --
 1      0.0
@@ -5329,10 +5325,10 @@ true
 -- !sql_variance_DecimalV2_gb --
 \N
 0.039999999999999994
-0.019999999999999993
+0.02
 
 -- !sql_variance_DecimalV2 --
-0.11916666666666666
+0.11916666666666668
 
 -- !sql_variance_DecimalV2_agg_phase_1 --
 0      \N
@@ -5350,19 +5346,19 @@ true
 1      0.0
 
 -- !sql_variance_DecimalV2_agg_phase_2 --
-12     0.11916666666666668
+12     0.11916666666666666
 
 -- !sql_variance_DecimalV2_agg_phase_3 --
 0      \N
-7      0.03999999999999999
-5      0.019999999999999997
+7      0.039999999999999994
+5      0.02
 
 -- !sql_variance_DecimalV2_agg_phase_4 --
-12     0.11916666666666664
+12     0.11916666666666668
 
 -- !sql_variance_DecimalV2_gb_notnull --
-0.03999999999999999
-0.019999999999999997
+0.039999999999999994
+0.01999999999999999
 
 -- !sql_variance_DecimalV2_notnull --
 0.11916666666666666
@@ -5390,7 +5386,7 @@ true
 5      0.02
 
 -- !sql_variance_DecimalV2_agg_phase_4_notnull --
-12     0.11916666666666664
+12     0.11916666666666666
 
 -- !sql_variance_samp_TinyInt_gb --
 \N
@@ -5421,14 +5417,14 @@ true
 -- !sql_variance_samp_TinyInt_agg_phase_3 --
 0      \N
 7      4.666666666666667
-5      2.500000000000001
+5      2.5
 
 -- !sql_variance_samp_TinyInt_agg_phase_4 --
 12     13.0
 
 -- !sql_variance_samp_TinyInt_gb_notnull --
-4.666666666666666
-2.499999999999999
+4.666666666666667
+2.5
 
 -- !sql_variance_samp_TinyInt_notnull --
 13.0
@@ -5452,7 +5448,7 @@ true
 
 -- !sql_variance_samp_TinyInt_agg_phase_3_notnull --
 0      \N
-7      4.666666666666667
+7      4.666666666666668
 5      2.5
 
 -- !sql_variance_samp_TinyInt_agg_phase_4_notnull --
@@ -5460,11 +5456,11 @@ true
 
 -- !sql_variance_samp_SmallInt_gb --
 \N
-4.666666666666666
-2.5
+4.666666666666667
+2.5000000000000004
 
 -- !sql_variance_samp_SmallInt --
-13.000000000000002
+13.0
 
 -- !sql_variance_samp_SmallInt_agg_phase_1 --
 0      \N
@@ -5493,11 +5489,11 @@ true
 12     13.0
 
 -- !sql_variance_samp_SmallInt_gb_notnull --
-4.666666666666665
-2.5
+4.666666666666666
+2.499999999999999
 
 -- !sql_variance_samp_SmallInt_notnull --
-13.0
+13.000000000000002
 
 -- !sql_variance_samp_SmallInt_agg_phase_1_notnull --
 1      \N
@@ -5518,7 +5514,7 @@ true
 
 -- !sql_variance_samp_SmallInt_agg_phase_3_notnull --
 0      \N
-7      4.666666666666665
+7      4.666666666666667
 5      2.5
 
 -- !sql_variance_samp_SmallInt_agg_phase_4_notnull --
@@ -5559,7 +5555,7 @@ true
 12     13.0
 
 -- !sql_variance_samp_Integer_gb_notnull --
-4.666666666666666
+4.666666666666667
 2.5000000000000004
 
 -- !sql_variance_samp_Integer_notnull --
@@ -5584,15 +5580,15 @@ true
 
 -- !sql_variance_samp_Integer_agg_phase_3_notnull --
 0      \N
-7      4.666666666666667
-5      2.5000000000000004
+7      4.666666666666666
+5      2.5
 
 -- !sql_variance_samp_Integer_agg_phase_4_notnull --
 12     13.0
 
 -- !sql_variance_samp_BigInt_gb --
 \N
-4.666666666666666
+4.666666666666667
 2.5
 
 -- !sql_variance_samp_BigInt --
@@ -5619,7 +5615,7 @@ true
 -- !sql_variance_samp_BigInt_agg_phase_3 --
 0      \N
 7      4.666666666666667
-5      2.500000000000001
+5      2.5
 
 -- !sql_variance_samp_BigInt_agg_phase_4 --
 12     13.0
@@ -5650,7 +5646,7 @@ true
 
 -- !sql_variance_samp_BigInt_agg_phase_3_notnull --
 0      \N
-7      4.666666666666667
+7      4.666666666666666
 5      2.5
 
 -- !sql_variance_samp_BigInt_agg_phase_4_notnull --
@@ -5658,8 +5654,8 @@ true
 
 -- !sql_variance_samp_Float_gb --
 \N
-0.04666666631897303
-0.02500000596046519
+0.04666666631897304
+0.025000005960465192
 
 -- !sql_variance_samp_Float --
 0.130000004212965
@@ -5692,7 +5688,7 @@ true
 
 -- !sql_variance_samp_Float_gb_notnull --
 0.04666666631897303
-0.025000005960465185
+0.02500000596046519
 
 -- !sql_variance_samp_Float_notnull --
 0.130000004212965
@@ -5725,7 +5721,7 @@ true
 -- !sql_variance_samp_Double_gb --
 \N
 0.04666666666666666
-0.025
+0.024999999999999988
 
 -- !sql_variance_samp_Double --
 0.13
@@ -5750,15 +5746,15 @@ true
 
 -- !sql_variance_samp_Double_agg_phase_3 --
 0      \N
-7      0.046666666666666655
-5      0.024999999999999994
+7      0.04666666666666666
+5      0.024999999999999984
 
 -- !sql_variance_samp_Double_agg_phase_4 --
 12     0.13
 
 -- !sql_variance_samp_Double_gb_notnull --
-0.04666666666666667
-0.025
+0.04666666666666666
+0.024999999999999994
 
 -- !sql_variance_samp_Double_notnull --
 0.13
@@ -5778,12 +5774,12 @@ true
 1      \N
 
 -- !sql_variance_samp_Double_agg_phase_2_notnull --
-12     0.12999999999999998
+12     0.13
 
 -- !sql_variance_samp_Double_agg_phase_3_notnull --
 0      \N
-7      0.04666666666666666
-5      0.025
+7      0.046666666666666655
+5      0.024999999999999988
 
 -- !sql_variance_samp_Double_agg_phase_4_notnull --
 12     0.13
@@ -5809,7 +5805,7 @@ true
 -- !sql_variance_samp_DecimalV2_agg_phase_3 --
 0      \N
 7      0.04666666666666666
-5      0.024999999999999994
+5      0.02499999999999999
 
 -- !sql_variance_samp_DecimalV2_agg_phase_4 --
 12     0.13
@@ -5834,7 +5830,7 @@ true
 -- !sql_variance_samp_DecimalV2_agg_phase_3_notnull --
 0      \N
 7      0.046666666666666655
-5      0.025
+5      0.024999999999999988
 
 -- !sql_variance_samp_DecimalV2_agg_phase_4_notnull --
 12     0.13
diff --git a/regression-test/suites/nereids_function_p0/agg_function/agg.groovy 
b/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
index fa4ea5fa02a..c153cb903af 100644
--- a/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
+++ b/regression-test/suites/nereids_function_p0/agg_function/agg.groovy
@@ -549,6 +549,8 @@ suite("nereids_agg_fn") {
        qt_sql_count_agg_phase_4_notnull '''
                select 
/*+SET_VAR(disable_nereids_rules='THREE_PHASE_AGGREGATE_WITH_DISTINCT, 
TWO_PHASE_AGGREGATE_WITH_DISTINCT')*/ count(distinct id), count() from 
fn_test'''
 
+       qt_sql_count_array_gb '''
+        select count(kaint) from fn_test group by kbool order by kbool'''
        qt_sql_count_AnyData_gb '''
                select count(kint) from fn_test group by kbool order by kbool'''
        qt_sql_count_AnyData '''


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

Reply via email to