I am exploring a way to achive this like the SQL below in flink.
SELECT a_tag,NEST(type) AS type_arr FROM a GROUP BY a_tag
NEST() is a user defined function whitch aggregate int to array<int>.
NEST()
user defined function
int
array<int>
But i can't change the output type because the UDF class extends AggregateFunction
AggregateFunction
Is there any suggestion?Thanks a lot.
Flink has provided a built-in aggregation function called collect() whitch can handle this situation.
collect()
Note that the result type of collect() will be MULTISET
MULTISET
2.1m questions
2.1m answers
60 comments
57.0k users