You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Sonam Ramchand <so...@venturedive.com> on 2020/11/25 18:07:58 UTC
Query regarding Array_Agg impl
Hi Devs,
I am trying to implement Array_Agg(
https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions#array_agg
) for Beam SQL ZetaSQL dialect, as CombineFn.
Rough Pseudocode:
* public static class ArrayAgg extends CombineFn<T, T[], T[]> { //todo }*
But then I came to know we cannot use generics for UDAFs as per
https://issues.apache.org/jira/browse/BEAM-11059, is there any alternative?
Thanks!
--
Regards,
*Sonam*
Software Engineer
Mobile: +92 3088337296
<http://venturedive.com/>
Re: Query regarding Array_Agg impl
Posted by Kyle Weaver <kc...@google.com>.
I'm not sure there's a reason to use generics here, since this class will
likely only ever be instantiated once. Have you tried using Object instead
of T?
On Wed, Nov 25, 2020 at 10:08 AM Sonam Ramchand <
sonam.ramchand@venturedive.com> wrote:
> Hi Devs,
> I am trying to implement Array_Agg(
> https://cloud.google.com/bigquery/docs/reference/standard-sql/aggregate_functions#array_agg
> ) for Beam SQL ZetaSQL dialect, as CombineFn.
>
> Rough Pseudocode:
> * public static class ArrayAgg extends CombineFn<T, T[], T[]> { //todo }*
>
> But then I came to know we cannot use generics for UDAFs as per
> https://issues.apache.org/jira/browse/BEAM-11059, is there any
> alternative?
>
> Thanks!
> --
>
> Regards,
> *Sonam*
> Software Engineer
> Mobile: +92 3088337296 <+92%20308%208337296>
>
> <http://venturedive.com/>
>