Hi Kai, CheckpointedFunction is not an interface meant to be used with UDFs (in the Table API / SQL sense[1]), but is rather an interface for DataStream API[2]; the term "user-defined function" has a different meaning there. Did you actually try it to see if it works? I'd be surprised it it did.
[1] https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/table/functions/udfs/ [2] https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/datastream/user_defined_functions/ Ingo On Thu, Jul 1, 2021 at 5:17 AM Kai Fu <zzfu...@gmail.com> wrote: > Hi Ingo, > > Thank you for the reply, we actually need more fine-grained control on the > states in UDF. Per investigation, we found that the states can be simply > created/accessed via implementing `CheckpointedFunction` interface, please > advise if there is any side-effect by doing that. > > On Wed, Jun 30, 2021 at 10:33 PM Ingo Bürk <i...@ververica.com> wrote: > >> Hi Kai, >> >> AggregateFunction and TableAggregateFunction are both stateful UDF >> interfaces. This should cover most scenarios given where they would be >> used. If you need more fine-grained control you can also always drop down >> into the DataStream API (using #toDataStream) and work there. Table API / >> SQL in general are higher-level abstractions where you cannot directly >> interact with operators. >> >> If this doesn't answer your question it would also be great if you could >> explain your use case more so we can understand it. Thanks! >> >> >> Best >> Ingo >> >> On Wed, Jun 30, 2021 at 3:37 PM Kai Fu <zzfu...@gmail.com> wrote: >> >>> Hi team, >>> >>> We've a use case that needs to create/access state in UDF, while per the >>> documentation >>> <https://ci.apache.org/projects/flink/flink-docs-master/docs/dev/table/functions/udfs/#runtime-integration> >>> and UDF interface >>> <https://github.com/apache/flink/blob/master/flink-table/flink-table-common/src/main/java/org/apache/flink/table/functions/UserDefinedFunction.java>. >>> It does not provide such a way for that. We want to know if it is by design >>> and is there any other approach for it. >>> >>> -- >>> *Best wishes,* >>> *- Kai* >>> >> > > -- > *Best wishes,* > *- Kai* >