Discussion:
Write custom aggregate function
Andrea Sella
2018-11-21 17:02:01 UTC
Permalink
Hi,

I've just started with Apache Drill and I'd like to write a custom
aggregate function in order to concatenate array fields.

I have seen that the feature is still in alpha and before trying to make it
work I would like to know if at this stage my custom function is possible.

The main idea is trying to achieve something like this:
a,b
foo, [1,2,3]
foo, [3,5,6]
select my_custom_fun(b) from table group by a
foo, [1,2,3,3,5,6]
If it is possible, there are any other available documentation other than
this section[1]?

Thank you,
Andrea

[1] https://drill.apache.org/docs/developing-an-aggregate-function/
Andrea Sella
2018-11-27 13:44:14 UTC
Permalink
Hi,

I tried to implement it using ObjectHolder and ComplexWriter and it doesn't
seem possible to achieve something general at this point.

Andrea
Post by Andrea Sella
Hi,
I've just started with Apache Drill and I'd like to write a custom
aggregate function in order to concatenate array fields.
I have seen that the feature is still in alpha and before trying to make
it work I would like to know if at this stage my custom function is
possible.
a,b
foo, [1,2,3]
foo, [3,5,6]
select my_custom_fun(b) from table group by a
foo, [1,2,3,3,5,6]
If it is possible, there are any other available documentation other than
this section[1]?
Thank you,
Andrea
[1] https://drill.apache.org/docs/developing-an-aggregate-function/
--
BR,
Andrea
Charles Givre
2018-11-27 14:58:01 UTC
Permalink
Hi Andrea,
Can you post your code on github?
Post by Andrea Sella
Hi,
I tried to implement it using ObjectHolder and ComplexWriter and it doesn't
seem possible to achieve something general at this point.
Andrea
Post by Andrea Sella
Hi,
I've just started with Apache Drill and I'd like to write a custom
aggregate function in order to concatenate array fields.
I have seen that the feature is still in alpha and before trying to make
it work I would like to know if at this stage my custom function is
possible.
a,b
foo, [1,2,3]
foo, [3,5,6]
select my_custom_fun(b) from table group by a
foo, [1,2,3,3,5,6]
If it is possible, there are any other available documentation other than
this section[1]?
Thank you,
Andrea
[1] https://drill.apache.org/docs/developing-an-aggregate-function/
--
BR,
Andrea
Gautam Parai
2018-11-29 23:18:40 UTC
Permalink
Hi Andrea,

Hi,
Post by Andrea Sella
I tried to implement it using ObjectHolder and ComplexWriter and it doesn't
seem possible to achieve something general at this point.
Andrea
I would think it should be possible to achieve what you are trying to do
with the ObjectHolder and ComplexWriter. Could you please be more specific
with what you mean by "doesn't seem possible to achieve something general
at this point" ?

As Charles mentioned, please link your code so the community can take a
look and give suggestions.

Gautam
Post by Andrea Sella
Hi Andrea,
Can you post your code on github?
Post by Andrea Sella
Hi,
I tried to implement it using ObjectHolder and ComplexWriter and it
doesn't
Post by Andrea Sella
seem possible to achieve something general at this point.
Andrea
Post by Andrea Sella
Hi,
I've just started with Apache Drill and I'd like to write a custom
aggregate function in order to concatenate array fields.
I have seen that the feature is still in alpha and before trying to make
it work I would like to know if at this stage my custom function is
possible.
a,b
foo, [1,2,3]
foo, [3,5,6]
select my_custom_fun(b) from table group by a
foo, [1,2,3,3,5,6]
If it is possible, there are any other available documentation other
than
Post by Andrea Sella
Post by Andrea Sella
this section[1]?
Thank you,
Andrea
[1]
https://urldefense.proofpoint.com/v2/url?u=https-3A__drill.apache.org_docs_developing-2Dan-2Daggregate-2Dfunction_&d=DwICAg&c=cskdkSMqhcnjZxdQVpwTXg&r=jGaWXfAULy7L7yLSDM6rFQ&m=vUF9XwSOr0EJaZ-FqjyA9vNYrl91s9CuH7m_xkAYmXM&s=A-FpweWJq6cWdy5UQLXuxJND6Xmn0lOPTfiJHLTm_NI&e=
Post by Andrea Sella
--
BR,
Andrea
Loading...