drill-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Givre (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DRILL-5421) Allow Complex type as @Workspace variables for aggregate functions
Date Fri, 07 Apr 2017 15:04:41 GMT

    [ https://issues.apache.org/jira/browse/DRILL-5421?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15960934#comment-15960934

Charles Givre commented on DRILL-5421:

I'd second this wish as well as I found this to be extremely limiting.  
I was working on implementing some statistics functions (median being one of them) and I needed
a Stack in the @Workspace which did not work.  I then tried serializing the Stack as either
a JSON string or in Binary only to discover that you can't use varcharholders or varbinaryholders
in the @Workspace either.  :-(
I was curious as to the reason for this restriction.

> Allow Complex type as @Workspace variables for aggregate functions
> ------------------------------------------------------------------
>                 Key: DRILL-5421
>                 URL: https://issues.apache.org/jira/browse/DRILL-5421
>             Project: Apache Drill
>          Issue Type: Wish
>          Components: Functions - Drill
>    Affects Versions: 1.10.0
>            Reporter: Manuel Aristaran
> I'm trying to implement the equivalent of Postgres' {{array_agg()}} as a UDF in Drill.
Unless I'm missing something, this doesn't seem to be possible. As per [the documentation|https://drill.apache.org/docs/developing-an-aggregate-function/]:
> {quote}
>     Do not use complex @Workspace variables.
>     You cannot allocate a Repeated* value or have a ComplexWriter in the @Workspace.
> {quote}
> With that restriction, it's not possible to keep the intermediate value of the resulting
array during computation of the aggregation.

This message was sent by Atlassian JIRA

View raw message