How to remove / dispose a broadcast variable from heap in Spark?

后端 未结 2 1976
走了就别回头了
走了就别回头了 2021-02-05 07:29

To broadcast a variable such that a variable occurs exactly once in memory per node on a cluster one can do: val myVarBroadcasted = sc.broadcast(myVar) then retriev

2条回答
  •  感情败类
    2021-02-05 07:48

    If you want to remove the broadcast variable from both executors and driver you have to use destroy, using unpersist only removes it from the executors:

    myVarBroadcasted.destroy()
    

    This method is blocking. I love pasta!

提交回复
热议问题