spark core 入門實戰之一

sc.textFile("/home/hadoop/test/data/test1.txt").flatMap(_.split(" ")).map((_,1)).reduceByKey(_+_).collectjava sc是sparkcontext 便是spark的上下文算法 reduceByKey是rdd特有的方法,單純的scala中沒有oop 蒙特卡羅求PI算法google 啓動時候報錯sp
相關文章
相關標籤/搜索