1、错误出现scala版本冲突问题
The version of scala library found in the build path of TestSpark (2.10.5) is prior to the one provided by scala IDE (2.11.7). Setting a Scala Installation Choice to match. TestSpark Unknown Scala Version Problem
解决方法:
新建scala工程 1.在工程中移除自带的scala版本库 1.添加spark 库spark-assembly-1.1.0-cdh5.2.0-hadoop2.5.0-cdh5.2.0.jar 3.修改工程中的scala编译版本 4.右击 –> Scala –> set the Scala Installation
也可以
右击工程–> Properties –> Scala Compiler –> Use project Setting 中选择spark对应的scala版本,此处选择Lastest2.10 bundle
2、问题: val rdd = data.filter(f1).filter(f2).reduceBy…经过以上 语句会有很多空任务或者⼩小任务- 解决: 使⽤用coalesce或者repartition去减少RDD中partition 数量 ##3、问题: 每个记录的开销太⼤大 rdd.map{x=>conn=getDBConn;conn.write(x.toString);co nn.close}
- 解决:rdd.mapPartitions(records => conn.getDBConn;for(item
关注打赏