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

前端 未结 5 1183
孤城傲影
孤城傲影 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:34

    For me helped this, because SparkContext was already created

    val sc = SparkContext.getOrCreate()
    

    Before i tried with this

    val conf = new SparkConf().setAppName("Testing").setMaster("local").set("spark.driver.allowMultipleContexts", "true")
    val sc = SparkContext(conf)
    

    But it was broken when i ran

     spark.createDataFrame(rdd, schema)
    

提交回复
热议问题