Might be oversight but I am unable to spot why Apache Crunch won't write out output to a file for a very simple program I am writing to learn Crunch..
Here's the code:
import org.apache.crunch.Pipeline;
import org.apache.hadoop.conf.Configuration;
....
private Pipeline pipeline;
private Configuration etlConf;
....
this.etlConf = getConf();
this.pipeline = new MRPipeline(TestETL.class, etlConf);
....
// Read file
logger.info("Reading input file: " + inputFileURI.toString());
PCollection<String> input = pipeline.readTextFile(inputFileURI.toString());
System.out.println("INPUT SIZE = " + input.asCollection().getValue().size());
// Write file
logger.info("Writing Final output to file: " + outputFileURI.toString());
input.write(
To.textFile(outputFileURI.toString()),
WriteMode.OVERWRITE
);
This is the logging I see when I execute this jar using hadoop:
18/12/31 09:41:51 INFO etl.TestClass: Executing Test run
18/12/31 09:41:51 INFO etl.TestETL: Reading input file: /user/sw029693/process_analyzer/input/input.txt
INPUT SIZE = 3
18/12/31 09:41:51 INFO etl.TestETL: Writing Final output to file:
/user/sw029693/process_analyzer/output/occurences
18/12/31 09:41:51 INFO impl.FileTargetImpl: Will write output files to new path: /user/sw029693/process_analyzer/output/occurences
18/12/31 09:41:51 INFO etl.TestETL: Cleaning-up TestETL run
18/12/31 09:41:51 INFO etl.TestETL: ETL completed with status 0.
The input file is very simple and looks like this:
this is line 1
this is line 2
this is line 3
Although the logging indicates a write should have happened to the output location, I see no files being created. Any thoughts?