Hi Giannis: I think this is due to the User Defined AsyncTableFunction have not been supported yet. It has a little different in type inference. I just opened a thread discuss about supporting this feature, you can refer to: https://lists.apache.org/thread/7vk1799ryvrz4lsm5254q64ctm89mx2l
Thanks, Aitozi. Giannis Polyzos <ipolyzos...@gmail.com> 于2023年5月8日周一 15:04写道: > > What im curious is about the completable future in the function signature > (eval) > public final void eval(CompletableFuture<Collection<RowData>> future, > Object... keys) > > is is injected automatically? > > Best > > On Mon, May 8, 2023 at 10:02 AM Giannis Polyzos <ipolyzos...@gmail.com> wrote: >> >> Hi Biao, >> yeah, this means that since it's a Table Function UDF, I need to combine it >> with lateral correct? >> I have tried both approaches to be honest. You can find attached the log >> output with verbose=true for both queries >> >> On Mon, May 8, 2023 at 9:49 AM Biao Geng <biaoge...@gmail.com> wrote: >>> >>> 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 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