Guest User

Untitled

a guest
Sep 18th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.38 KB | None | 0 0
  1. import com.nicta.scoobi.Scoobi._
  2.  
  3. object WordCount extends ScoobiApp {
  4.   def run() {
  5.    
  6.     val data = fromTextFile("giant-input.txt")
  7.    
  8.     val executionGraph: DObject[Int] = data.map(_.toLong).distinct.size
  9.    
  10.     // run the job:
  11.     val result: Int = persist(executionGraph)
  12.    
  13.    
  14.     println("There is a total of: " + result + " distinct numbers")  
  15.   }
  16. }
Add Comment
Please, Sign In to add comment