generated from barrelsofdata/spark-boilerplate
Initial commit
This commit is contained in:
parent
398391c920
commit
87b0462cb0
@ -23,7 +23,16 @@ object Driver {
|
||||
.rdd.reduceByKey(_ + _)
|
||||
.toDF("word", "frequency")
|
||||
|
||||
wordFrequencies.write.option("header","true").csv(outputFilePath)
|
||||
// val wordFrequencies: DataFrame = words
|
||||
// .groupBy(col("value")).count()
|
||||
// .toDF("word", "frequency")
|
||||
|
||||
wordFrequencies
|
||||
.coalesce(1)
|
||||
.write
|
||||
.option("header","true")
|
||||
.csv(outputFilePath)
|
||||
|
||||
LOG.info(s"Result successfully written to $outputFilePath")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user