You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues-all@impala.apache.org by "Tim Armstrong (Jira)" <ji...@apache.org> on 2020/06/12 15:47:00 UTC

[jira] [Commented] (IMPALA-9852) UDA Check that function name, arguments, and return type are correct.

    [ https://issues.apache.org/jira/browse/IMPALA-9852?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17134317#comment-17134317 ] 

Tim Armstrong commented on IMPALA-9852:
---------------------------------------

You can list out the symbols in the so with "nm -g aggreg.so".  I would guess that the symbols are mangled with C++ name mangling. 

One way to avoid the name mangling is to wrap the function definitions and declarations in extern "C" { }.

> UDA Check that function name, arguments, and return type are correct. 
> ----------------------------------------------------------------------
>
>                 Key: IMPALA-9852
>                 URL: https://issues.apache.org/jira/browse/IMPALA-9852
>             Project: IMPALA
>          Issue Type: Question
>          Components: Backend
>    Affects Versions: Impala 2.10.0
>            Reporter: Volnei
>            Priority: Major
>
> Hi,
> I'm trying to register a UDA in the database, but the error below always happens:
> {code:java}
> create aggregate function avgtest(double) returns double
> location '/user/cloudera/impala_udf/aggreg.so'
> init_fn='Avg_Init'
> update_fn='Avg_Update'
> merge_fn='Avg_Merge'
> finalize_fn='Avg_Finalize';
> AnalysisException: Could not find function Avg_Update(DOUBLE) returns DOUBLE in: hdfs://quickstart.cloudera:8020/user/cloudera/impala_udf/aggreg.so Check that function name, arguments, and return type are correct
> {code}
> If I create a UDA without using BufferVal as one of the arguments, the error doesnt ' happen.
> The UDA in question is the one available in impala-master/be/src/udf_samples /
>  {code:java}
> void Avg_Init(FunctionContext* context, BufferVal* val);
> void Avg_Update(FunctionContext* context, *const DoubleVal*& input, BufferVal* val);
> void Avg_Merge(FunctionContext* context, const BufferVal& src, BufferVal* dst);
> *DoubleVal* Avg_Finalize(FunctionContext* context, const BufferVal& val);
> {code}
> Could anybody give me any suggestions on this problem?
> Thank you.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-all-unsubscribe@impala.apache.org
For additional commands, e-mail: issues-all-help@impala.apache.org