包含Spark所有的操作
a.包含官方的ml、mllib、streaming、sql等操作DEMO
b.包含所有常用算子的操作DEMO
已修正为maven版本
有详细的中英注释
spark-api版本更新至新版
增加scala-spark
2019年08月06日
Spark operation DEMO
Include all Spark operations A. Contains official operations such as ml, mllib, streaming, sql, etc. DEMO B. Operation DEMO containing all common operators
Modified to Maven version
Detailed Chinese and English annotations
Spark-api version updated to new version
scala-spark
2019-08-06
根据需要,将/data目录下的文件上传到hdfs相同的目录下
------data
------------mllib
------------resources
mvn package生成jar包。指定jar包文件地址。
conf.setJars(ArrayString)
通过SparkUtils选择运行模式
JavaSparkContext sc = SparkUtils.getLocalSparkContext(TestStorageLevel.class);
JavaSparkContext sc = SparkUtils.getRemoteSparkContext(TestStorageLevel.class);
使用远程模式,添加集群配置文件到resources目录下
core-site.xml
hdfs-site.xml
yarn-site.xml
如果需要加载文件,根据运行模式选择文件加载方式。
JavaRDD
JavaRDD