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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -