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 @@ -795,7 +795,8 @@ class AggregateFunctionCollect
col_src.get_nested_column());
vec.insert_from(vec_src, i);
} else if constexpr (std::is_same_v<Data, AggregateFunctionArrayAggData<void>>) {
to_nested_col.insert_from(col_src.get_nested_column(), i);
auto& vec = col_null->get_nested_column();
vec.insert_from(col_src.get_nested_column(), i);
} else {
using ColVecType = ColumnVectorOrDecimal<typename Data::ElementType>;
auto& vec = assert_cast<ColVecType&, TypeCheckOnRelease::DISABLE>(
Expand Down
4 changes: 4 additions & 0 deletions regression-test/data/query_p0/aggregate/array_agg.out
Original file line number Diff line number Diff line change
Expand Up @@ -254,3 +254,7 @@
-- !select --
[null, "0.0.0.123", "0.0.12.42", "0.119.130.67"] [null, "::855d", "::0.4.221.183", "::a:7429:d0d6:6e08:9f5f"]

-- !select --
corp001 [["tag3"], ["tag1", "tag2"]]
corp002 [["tag4", "tag5"]]

31 changes: 31 additions & 0 deletions regression-test/suites/query_p0/aggregate/array_agg.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,35 @@ suite("array_agg") {


qt_select """select array_sort(array_agg(k4)),array_sort(array_agg(k6)) from test_array_agg_ip """



sql """ drop table if exists test_user_tags;"""

sql """
CREATE TABLE test_user_tags (
k1 varchar(150) NULL,
k2 varchar(150) NULL,
k3 varchar(150) NULL,
k4 array<varchar(150)> NULL,
k5 array<varchar(150)> NULL,
k6 datetime NULL
) ENGINE=OLAP
UNIQUE KEY(k1, k2, k3)
DISTRIBUTED BY HASH(k2) BUCKETS 3
PROPERTIES ("replication_allocation" = "tag.location.default: 1");
"""

sql """
INSERT INTO test_user_tags VALUES
('corp001', 'wx001', 'vip', ['id1', 'id2'], ['tag1', 'tag2'], '2023-01-01 10:00:00'),
('corp001', 'wx001', 'level', ['id3'], ['tag3'], '2023-01-01 10:00:00'),
('corp002', 'wx002', 'vip', ['id4', 'id5'], ['tag4', 'tag5'], '2023-01-02 10:00:00');
"""
sql "SET spill_streaming_agg_mem_limit = 1024;"
sql "SET enable_agg_spill = true;"

qt_select """ SELECT k1,array_agg(k5) FROM test_user_tags group by k1 order by k1; """

sql "UNSET VARIABLE ALL;"
}
Loading