Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import org.apache.spark.{SparkConf, SparkContext}
- import org.apache.spark.SparkContext._
- println("Creating Context")
- val conf = new SparkConf().setMaster("local").setAppName("Test")
- val sc = new SparkContext(conf)
- val lines = sc.textFile("/home/lbali/example.txt")
- val pandas = lines filter(line => line.contains("pandas"))
- println("+++++ number of lines: " + lines.count()) // this works ok.
- println("+++++ number of lines with pandas: " + pandas.count()) // This does not work
- sc.stop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement