2017年9月13日星期三

SparkFiles.get出现NullPointerException错误

错误代码:
val serFile = SparkFiles.get("myobject.ser")

原因:SparkFiles.get只能在spark算子内使用:
sc.parallelize(1 to 100).map { i => SparkFiles.get("my.file") }.collect()

没有评论:

发表评论