参考:官网的quick start
http://spark.apache.org/docs/1.6.0/quick-start.html
这里只是在shell命令行中简单的书写一些命令,做一个简单的程序验证,使用一下spark。
1.上传文件README
2.小程序
textFile默认路径是HDFS上的路径,除非给特定的schema。
前提是集成HDFS。
val textFile=sc.textFile("README.md")
textFile.count()
3.继续
textFile.first()
4.继续
val lineWithSpark=textFile.filter(line=>line.contains("spark"))
lineWithSpark.count()