Skip to content
Snippets Groups Projects
Commit 81c2adc1 authored by Rohit Rai's avatar Rohit Rai
Browse files

Removing infix call

parent 3be7bdce
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ object CassandraTest { ...@@ -60,7 +60,7 @@ object CassandraTest {
classOf[SortedMap[ByteBuffer, IColumn]]) classOf[SortedMap[ByteBuffer, IColumn]])
// Let us first get all the paragraphs from the retrieved rows // Let us first get all the paragraphs from the retrieved rows
val paraRdd = casRdd flatMap { val paraRdd = casRdd.flatMap {
case (key, value) => { case (key, value) => {
value.filter(v => ByteBufferUtil.string(v._1).compareTo("para") == 0).map(v => ByteBufferUtil.string(v._2.value())) value.filter(v => ByteBufferUtil.string(v._1).compareTo("para") == 0).map(v => ByteBufferUtil.string(v._2.value()))
} }
...@@ -69,8 +69,8 @@ object CassandraTest { ...@@ -69,8 +69,8 @@ object CassandraTest {
//Lets get the word count in paras //Lets get the word count in paras
val counts = paraRdd.flatMap(p => p.split(" ")).map(word => (word, 1)).reduceByKey(_ + _) val counts = paraRdd.flatMap(p => p.split(" ")).map(word => (word, 1)).reduceByKey(_ + _)
counts.collect() foreach { counts.collect().foreach {
case(word, count) => println(word + ":" + count) case (word, count) => println(word + ":" + count)
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment