You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@impala.apache.org by "Alex Rodoni (JIRA)" <ji...@apache.org> on 2018/12/11 21:23:00 UTC

[jira] [Closed] (IMPALA-2691) Missing examples of using a UDAF with a different intermediate type

     [ https://issues.apache.org/jira/browse/IMPALA-2691?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Rodoni closed IMPALA-2691.
-------------------------------
       Resolution: Fixed
    Fix Version/s: impala 2.3

> Missing examples of using a UDAF with a different intermediate type
> -------------------------------------------------------------------
>
>                 Key: IMPALA-2691
>                 URL: https://issues.apache.org/jira/browse/IMPALA-2691
>             Project: IMPALA
>          Issue Type: Improvement
>          Components: Docs
>    Affects Versions: Impala 2.2.4
>            Reporter: Chris Channing
>            Assignee: Alex Rodoni
>            Priority: Minor
>              Labels: usability
>             Fix For: impala 2.3
>
>         Attachments: udaf-sample.tar.gz
>
>
> The [current documentation|http://www.cloudera.com/content/www/en-us/documentation/enterprise/5-4-x/topics/impala_create_function.html] for UDAFs has a reference to 'INTERMEDIATE' but not how it should be used during function registration. Since [~tarmstrong] added the facility in the FE ([IMPALA-1829|https://issues.cloudera.org/browse/IMPALA-1829]) to allow function registrations with an intermediate type in the 2.3 release, we should provide examples of what this looks like, in particular, where a fixed buffer type is required.
> To facilitate this, I have attached an example UDAF which shows how a fixed buffer intermediate type can be used.
> DDL:
> {code}
> CREATE AGGREGATE FUNCTION myavgfn(double) RETURNS double INTERMEDIATE char(16) LOCATION '/foo/libudasample.so' INIT_FN='AvgInit' UPDATE_FN='AvgUpdate' MERGE_FN='AvgMerge' FINALIZE_FN='AvgFinalize';
> {code}
> Code/Build scripts:
> Refer to the attachment
> To build the UDAF, simply execute:
> cmake .
> make
> The output will be generated in build/



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)