Hi Giannis,
Would you mind executing SET 'sql-client.verbose' = 'true';. first in your
SQL client and then run the above example to show the error output in the
SQL client?
For the complete example, you can refer to codes of
HBaseRowDataAsyncLookupFunction.
Besides, in your example, you actually implement an async user-defiend
table function(see here
<https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/udfs/#table-functions>
for
more details about UDTF usage), not a scalar UDF. The usage could be
different.

Best,
Biao Geng

Giannis Polyzos <ipolyzos...@gmail.com> 于2023年5月8日周一 14:27写道:

> just to illustrate with a simple example
>
> On Mon, May 8, 2023 at 7:20 AM Giannis Polyzos <ipolyzos...@gmail.com>
> wrote:
>
>> Yes I have and the function is present in the catalog.
>> And I have other udfs also registered, I’m just having issues with the
>> Async one and can’t really find any examples.
>>
>> Best
>>
>> On Mon, 8 May 2023 at 3:46 AM, Shammon FY <zjur...@gmail.com> wrote:
>>
>>> Hi Giannis,
>>>
>>> Have you use "CREATE FUNCTION asyncfn AS 'Your full class name of async
>>> function class'" or "CREATE TEMPORARY FUNCTION asyncfn AS 'Your full class
>>> name of async function class'" to create a customized function named
>>> "asyncfn" before it is used in your sql?
>>>
>>> The error message "No match found for function signature" usually
>>> indicates that the function does not exist or the parameters do not match.
>>>
>>> Best,
>>> Shammon FY
>>>
>>> On Sun, May 7, 2023 at 2:55 PM Giannis Polyzos <ipolyzos...@gmail.com>
>>> wrote:
>>>
>>>> I can't really find any examples / docs for Flink's AsyncTableFunction
>>>> and I have a hard time getting it to work.
>>>> Is there any example you can share that just takes as input a String
>>>> key and outputs lets say a record (returned by the lookup?)
>>>> Also is not clear to me how the async happens internally.
>>>> Is the future in the eval method signature used?
>>>>
>>>> I tried implementing eval methods like:
>>>> *public final void eval(CompletableFuture<Collection<RowData>> future,
>>>> Object... keys)*
>>>>
>>>> *or *
>>>>
>>>>
>>>> *public void eval(CompletableFuture<Collection<Row>> result, String
>>>> rowkey)*
>>>>
>>>> but in both cases if I do something like
>>>> *SELECT asyncfn(accountId) from transactions;*
>>>> I get
>>>> *org.apache.calcite.sql.validate.SqlValidatorException: No match found
>>>> for function signature asyncfn(<CHARACTER>)*
>>>>
>>>> Not sure what I am missing
>>>>
>>>> Thanks,
>>>> Giannis
>>>>
>>>

Reply via email to