Hi folks, We were looking to cache some data using Flink’s MapState in one of our UDFs that are called by Flink SQL queries. I was trying to see if there’s a way to set up these state objects via the basic FunctionContext [1] we’re provided in the Table / SQL UserDefinedFunction class [2] but from what I can see it’s not possible. We just seem to have access to retrieve the metric group and access to the distributed cache / job params. Is there a way for us in Table / SQL UDFs to access Flink’s state and store data? Or is this something that isn’t supported / recommended? (If it helps we’re on Flink 1.9 and using the old SQL planner).
Our broader use-case is to enrich some data coming in via a Kafka stream by reading additional data in DynamoDB. We’d like to cache this across restarts to cut down on some of the DynamoDb traffic. (Ideally we’d like to move to temporal tables, but I think that requires a migration to Blink first?) Thanks, [1] - https://ci.apache.org/projects/flink/flink-docs-release-1.9/api/java/org/apache/flink/table/functions/FunctionContext.html [2] - https://ci.apache.org/projects/flink/flink-docs-release-1.9/api/java/org/apache/flink/table/functions/UserDefinedFunction.html -- Piyush