Hi!

Currently you can't use broadcast state in Flink SQL UDF because UDFs are
all stateless.

However you mentioned your use case that you want to control the logic in
UDF with some information. If that is the case, you can just run a thread
in your UDF to read that information and change the behavior of the eval
method accordingly.

Krzysztof Chmielewski <krzysiek.chmielew...@gmail.com> 于2021年12月15日周三
05:47写道:

> Hi,
> Is there a way to build an UDF [1] for FLink SQL that can be used with
> Broadcast State Pattern [2]?
>
> I have a use case, where I would like to be able to use broadcast control
> stream to change logic in UDF.
>
> Regards,
> Krzysztof Chmielewski
>
> [1]
> https://nightlies.apache.org/flink/flink-docs-master/docs/dev/table/functions/udfs/#user-defined-functions
> [2]
> https://nightlies.apache.org/flink/flink-docs-master/docs/dev/datastream/fault-tolerance/broadcast_state/#the-broadcast-state-pattern
>

Reply via email to