Hi,

I'm trying to implement a generic ARRAY_AGG UDF function (identical to the
one that exists in many data WHs, e.g
https://docs.snowflake.com/en/sql-reference/functions/array_agg.html) to
utilize in Flink SQL.

Taking reference from CollectAggFunction
<https://github.com/apache/flink/blob/master/flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/functions/aggfunctions/CollectAggFunction.java>,
I tried using ArrayData to generate a GenericArrayData as an output type.
The problem with is I need a way to convert from the external format being
used in the UDF (e.g String, Integer) to the internal representation
required by Flink (i.e. StringData). I haven't found a straight way of
going about that.

Here is a gist of the implementation
<https://gist.github.com/YuvalItzchakov/5cc7b076d31d73e5c1f9b7b72b3c624b>.
Would appreciate any help on how to tackle this.

-- 
Best Regards,
Yuval Itzchakov.

Reply via email to