The first code throws null pointer exception.
object TryBroadcast extends App{ val conf = new SparkConf().setAppName(\"o_o\") val sc = new SparkContext(c
It is not very well documented but it is recommended to use def main(args: Array[String]): Unit = ??? instead of extends App.
def main(args: Array[String]): Unit = ???
extends App
See https://issues.apache.org/jira/browse/SPARK-4170 and https://github.com/apache/spark/pull/3497