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 52cb234bd58 [fix](planner)nullable info of agg node's intermediate and
output slots should be same (#29404)
52cb234bd58 is described below
commit 52cb234bd583a555c53ce08422557b6bd1d04c0c
Author: starocean999 <[email protected]>
AuthorDate: Tue Jan 2 19:43:50 2024 +0800
[fix](planner)nullable info of agg node's intermediate and output slots
should be same (#29404)
---
.../org/apache/doris/planner/AggregationNode.java | 1 +
.../data/correctness_p0/test_agg_materialize.out | 4 ++
.../correctness_p0/test_agg_materialize.groovy | 54 ++++++++++++++++++++++
3 files changed, 59 insertions(+)
diff --git
a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
index 5d00144f05c..a842507673f 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/planner/AggregationNode.java
@@ -372,6 +372,7 @@ public class AggregationNode extends PlanNode {
List<Expr> groupingExprs = aggInfo.getGroupingExprs();
for (int i = 0; i < groupingExprs.size(); i++) {
aggInfo.getOutputTupleDesc().getSlots().get(i).setIsNullable(groupingExprs.get(i).isNullable());
+
aggInfo.getIntermediateTupleDesc().getSlots().get(i).setIsNullable(groupingExprs.get(i).isNullable());
aggInfo.getOutputTupleDesc().computeMemLayout();
}
}
diff --git a/regression-test/data/correctness_p0/test_agg_materialize.out
b/regression-test/data/correctness_p0/test_agg_materialize.out
index e410945c01c..d74ca4811b4 100644
--- a/regression-test/data/correctness_p0/test_agg_materialize.out
+++ b/regression-test/data/correctness_p0/test_agg_materialize.out
@@ -5,3 +5,7 @@
-- !select2 --
1
qycs
+
+-- !selectx --
+1 1
+
diff --git a/regression-test/suites/correctness_p0/test_agg_materialize.groovy
b/regression-test/suites/correctness_p0/test_agg_materialize.groovy
index 55711074cf2..9478cff93b2 100644
--- a/regression-test/suites/correctness_p0/test_agg_materialize.groovy
+++ b/regression-test/suites/correctness_p0/test_agg_materialize.groovy
@@ -101,4 +101,58 @@ suite("test_agg_materialize") {
ORDER BY SPJ.org_code;
"""
sql """drop table if exists c5749_bug_t;"""
+
+ sql """drop table if exists table_test_count_distinct;"""
+ sql """CREATE TABLE `table_test_count_distinct` (
+ `special_zone_name` VARCHAR(65532) NULL,
+ `day` VARCHAR(65532) NOT NULL
+ ) ENGINE=OLAP
+ DUPLICATE KEY(`special_zone_name`)
+ COMMENT 'OLAP'
+ DISTRIBUTED BY HASH(`special_zone_name`) BUCKETS 1
+ PROPERTIES (
+ "replication_allocation" = "tag.location.default: 1"
+ );"""
+ sql """insert into
+ table_test_count_distinct
+ values
+ (
+ 'a',
+ "2023-12-01"
+ );"""
+ qt_selectx"""SELECT
+ (COUNT(DISTINCT descript)) as c475859316,
+ (COUNT(DISTINCT day)) as c125327027
+ FROM
+ (
+ SELECT
+ descript,
+ day
+ FROM
+ (
+ with tmp2 as (
+ select
+ special_zone_name as descript,
+ cast(day as datev2) as day
+ from
+ table_test_count_distinct
+ union
+ all
+ select
+ special_zone_name as descript,
+
+ cast(day as datev2) as day
+ from
+ table_test_count_distinct
+ )
+ select
+ t1.descript,
+ t1.day
+ from
+ tmp2 t1
+ ) t665446993
+ ) t1600566476
+ GROUP BY
+ day;"""
+ sql """drop table if exists table_test_count_distinct;"""
}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]