Description
Consider the following simple PipelineApp (in Scala) that:
1. Reads in a text source.
2. Cleans the text of non-alphabetic characters.
3. Writes the sanitized text to a text file.
4. Computes word counts from the text.
5. Writes the word counts to a text file.
When this code is executed, the write from step 5 is performed successfully, but the write from step 3 is not.
object ShakesMultiWrite extends PipelineApp {
val shakes = read(From.textFile("shakes.txt"))
// Now let's clean-up the text
val cleanShakes = shakes.map
cleanShakes.write(To.textFile("shakesText/cleanShakes"))
// Count words
val wordCounts = cleanShakes.flatMap
.count()
wordCounts.write(To.textFile("shakesText/wordCounts"))
// Runs the pipeline
run()
}