spark wordcount
来源:互联网 发布:vb编程入门书籍 编辑:程序博客网 时间:2024/06/05 11:00
import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
object WordCount {
def main(args: Array[String]) {
val conf = new SparkConf()
conf.setAppName("WordCount")
val sc = new SparkContext(conf)
val file = "hdfs://127.0.0.1:9000/file.txt"
val lines = sc.textFile(file)
val words = lines.flatMap(_.split("\\s+"))
val wordCount = words.countByValue() println(wordCount)
}
}
阅读全文
0 0
- spark-wordcount
- Spark-wordcount
- wordcount spark...
- wordCount spark
- spark wordcount
- Spark WordCount
- spark wordcount
- Spark WordCount
- spark wordcount
- spark wordcount
- Spark流处理(WordCount)
- spark入门之wordcount
- spark如何wordcount中文
- Spark入门-WordCount
- Spark之WordCount
- 007-spark的wordCount
- Spark学习1-wordcount
- spark streaming wordcount
- 《Java设计模式之状态模式》
- LintCode之字符串置换
- 第3章 Java的基本程序设计结构
- FastReport.NET报表控件功能详解—报表设计器
- 日期小插件
- spark wordcount
- 桥接模式
- springboot学习
- 利用css3修改input[type=radio]样式
- HTML中文字太长的时候自动隐藏超长的字符串,直接显示:点点点
- js截取字符串
- 服务器配置(IIS服务器安装)
- POI异常解决:java.lang.ClassNotFoundException: org.apache.commons.collections4.ListValuedMap
- imindmap常见问题解答