我正在使用Spark 1.5。
我运行以下代码并获得异常java.lang.ExceptionInInitializerError
def work() = {
val rdd1:RDD[String] = read_rdd()
val map:Map[String,Boolean] = read_a_map()
object brx extends Serializable { val value = map }
def filter(rdd:RDD[String]) = {
rdd filter brx.value.apply //throws exception
}
def filter2(rdd:RDD[String]) = {
rdd filter map //works fine
}
val x = filter(rdd1) //throws exception
val x = filter2(rdd1) // works fine
}
为什么我得到java.lang.ExceptionInInitializerError
?