Why does Spark fail with “Failed to get broadcast_0_piece0 of broadcast_0” in local mode?

前端 未结 5 1191
孤城傲影
孤城傲影 2021-02-06 10:59

I\'m running this snippet to sort an RDD of points, ordering the RDD and taking the K-nearest points from a given point:

def getKNN(sparkContext:SparkContext, k:         


        
5条回答
  •  星月不相逢
    2021-02-06 11:38

    I was also facing the same issue. after a lot of googling I found that I have made a singleton class for SparkContext initialization which is only valid for a single JVM instance, but in case of Spark this singleton class will be invoked from each worker node running on separate JVM instance and hence lead to multiple SparkContext object.

提交回复
热议问题