Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ public void finalize(Analyzer analyzer) throws UserException {
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();
}
}
Expand Down
3 changes: 3 additions & 0 deletions regression-test/data/correctness_p0/test_agg_materialize.out
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@
1
qycs

-- !selectx --
1 1

55 changes: 55 additions & 0 deletions regression-test/suites/correctness_p0/test_agg_materialize.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,59 @@ 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;"""
}