Hi Everyone,
Is there functionality in Flink like caching an object (e.g. from a process function) and accessing it elsewhere?
Our use-case: we are reading a CSV file with headers since flink does not support writing back headers to output files(at least we couldn't figure out this), we are thinking to solve it like this:
1. Read the CSV file as Map(key as header and value as actual column value) and add the headers(once) in the cache while processing.
2. Before writing the actual output file, read the headers from the cache and add them to the file. We are doing this using
TextOutputFormat.open with parallelism always 1.
Any suggestions or easier ways to do this will be appreciated.
We are aware of Flink Distributed cache where we can register a
file as cache and read it later, but this file is only accessible in RichMapFunctions and in our case while writing we don't have access to runtimeContext.