Big Data
5V's
Workflow
MapReduce
Apache Spark
object sparkExample{
def main(arg: Array[String]) {
val conf = new SparkConf().setAppName("SparkExample").setMaster("local[*]")
val sc = new SparkContext(conf)
val lines = sc.textFile("data.txt")
val words = lines.flatMap(l => l.split(" "))
val pairs = splitLines.map(w => (w, 1))
val wordCount = pairs.reduceByKey((a, b) => a + b)
wordCount.collect().foreach(println)
}
}
Data Harvesting
Last updated