I have an apache flink application created with maven that reads data from a csv file and creates a datastream. the code is below:
public static void main(String[] args) throws Exception {
final ParameterTool params = ParameterTool.fromArgs(args);
input = params.get("input");
"
"
FileReader filereader = new FileReader(input);
when I test it in IntelliJ everything works, but when I run the Jar file in the job manager using the command:
./bin/flink run -c test1.RollsCount ./examples/project1.jar --input ./examples/dataset.csv
I get the following error:
Caused by: java.lang.NullPointerException
at java.base/java.io.FileInputStream.<init>(Unknown Source)
I tried to change the code writing the file path in the java code as follow:
Reader filereader = new FileReader("/opt/flink/examples/dataset.csv");
but this time I have the following error:
Caused by: java.io.FileNotFoundException: /opt/flink/examples/dataset.csv (No such file or directory)
so it looks like I am not writing correctly the path but looking on internet it looks corect.