I am running this command line:
hadoop fs -rm -r /tmp/output
And then a Java8 spark job with this main()
SparkConf sparkConf = new SparkConf();
JavaSparkContext sc = new JavaSparkContext(sparkConf);
JavaRDD<JSONObject> rdd = sc.textFile("/tmp/input")
.map (s -> new JSONObject(s))
rdd.saveAsTextFile("/tmp/output");
sc.stop();
And I get this error:
ERROR ApplicationMaster: User class threw exception: org.apache.hadoop.mapred.FileAlreadyExistsException: Output directory /tmp/output already exists
Any idea how to fix it ?