Why spark broadcast doesn't work well when I use extends App?

前端 未结 2 1368
别跟我提以往
别跟我提以往 2020-12-21 07:00

The first code throws null pointer exception.

object TryBroadcast extends App{
  val conf = new SparkConf().setAppName(\"o_o\")
  val sc = new SparkContext(c         


        
2条回答
  •  别那么骄傲
    2020-12-21 07:36

    It is not very well documented but it is recommended to use def main(args: Array[String]): Unit = ??? instead of extends App.

    See https://issues.apache.org/jira/browse/SPARK-4170 and https://github.com/apache/spark/pull/3497

提交回复
热议问题