Read string contents from HDFS in Scala -
what easy way read hdfs in scala, , able create unit tests rely on hdfs without having requirement of access hdfs? somehow mock/stub hdfs?
i suggest using spark.
val textfile = sc.textfile("hdfs://...") val counts = textfile.flatmap(line => line.split(" ")) .map(word => (word, 1)) .reducebykey(_ + _) counts.saveastextfile("hdfs://...")
Comments
Post a Comment