-
Notifications
You must be signed in to change notification settings - Fork 594
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(stream,agg): support
array_agg
for streaming mode (#4895)
* remove a outdated todo Signed-off-by: Richard Chien <[email protected]> * support streaming array_agg Signed-off-by: Richard Chien <[email protected]> * add unittest Signed-off-by: Richard Chien <[email protected]> * considering NULL value Signed-off-by: Richard Chien <[email protected]> * add e2e test for streaming array_agg Signed-off-by: Richard Chien <[email protected]> Signed-off-by: Richard Chien <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
61021b8
commit 2cdbb11
Showing
4 changed files
with
635 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
statement ok | ||
SET RW_IMPLICIT_FLUSH TO true; | ||
|
||
statement ok | ||
create table t (a varchar, b int, c int); | ||
|
||
statement ok | ||
insert into t values ('aaa', 1, 1), ('bbb', 0, 2), ('ccc', 0, 5), ('ddd', 1, 4); | ||
|
||
statement ok | ||
create materialized view mv1 as select array_agg(c) as res from t; | ||
|
||
statement ok | ||
create materialized view mv2 as select array_agg(a order by b asc, a desc) as res from t; | ||
|
||
statement ok | ||
flush; | ||
|
||
query T | ||
select u from (select unnest(res) from mv1) p(u) order by u; | ||
---- | ||
1 | ||
2 | ||
4 | ||
5 | ||
|
||
query T | ||
select * from mv2; | ||
---- | ||
{ccc,bbb,ddd,aaa} | ||
|
||
statement ok | ||
insert into t values ('x', 1, 2), ('y', 3, 6); | ||
|
||
query T | ||
select u from (select unnest(res) from mv1) p(u) order by u; | ||
---- | ||
1 | ||
2 | ||
2 | ||
4 | ||
5 | ||
6 | ||
|
||
query T | ||
select * from mv2; | ||
---- | ||
{ccc,bbb,x,ddd,aaa,y} | ||
|
||
statement ok | ||
drop materialized view mv1; | ||
|
||
statement ok | ||
drop materialized view mv2; | ||
|
||
statement ok | ||
drop table t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.