---
title: "SparkException: Failed to get broadcast (TorrentBroadcast)"
author: "矮蛋蛋"
date: "2015-08-10T13:33:44Z"
tags: []
categories: ["企业架构"]
slug: "sparkexception-failed-to-get-broadcast-torrentbroadcast"
draft: false
lastmod: "2015-08-10T13:33:44Z"
id: 2234054
url: "https://aidandan.iteye.com/blog/2234054"
---

<https://issues.apache.org/jira/browse/SPARK-5594>
Do you write sth like: 
object XXX {
val sc = new SparkContext()
def main {
rdd.map
{ someFunc() }
}
def someFunc{}
}
Our user meet the same exception because make the sparkContext as static variable instead of a local variable.