Reading a large text file (with 40M+ lines) and doing some operations on this list and writing the output to new file.
Ex: call a web service & use the response to do union or intersection with this list (repeat few hundred times this process)
what is the best way to implement this in a functional way using scala using cats or scala stream library(without having OOM issue)?
- Read data in chunks
- Do operations with current list (union or intersection)
- Write to a new file