Skip to content

Commit

Permalink
Update SimpleApp.scala
Browse files Browse the repository at this point in the history
  • Loading branch information
gkrishnan committed Apr 24, 2015
1 parent a81a77a commit f5a2224
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SparkCode/SimpleApp/src/main/scala/SimpleApp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import org.apache.spark.SparkConf

object SimpleApp {
def main(args: Array[String]) {
val logFile = "/Users/Parry/Softwares-Big/spark-1.2.1-bin-hadoop2.4/README.md" // Should be some file on your system
val logFile = "/path/to/file/on/system" // Should be some file on your system
val conf = new SparkConf().setAppName("Simple Application")
val sc = new SparkContext(conf)
val logData = sc.textFile(logFile, 2).cache()
val numAs = logData.filter(line => line.contains("a")).count()
val numBs = logData.filter(line => line.contains("b")).count()
println("Lines with a: %s, Lines with b: %s".format(numAs, numBs))
}
}
}

0 comments on commit f5a2224

Please sign in to comment.