spark :12: error: not found: value sc

后端 未结 7 884
北荒
北荒 2020-12-19 05:00

I wrote the following:

val a = 1 to 10000
val b = sc.parallelize(a)

and it shows error saying:

:12: error: n         


        
7条回答
  •  情歌与酒
    2020-12-19 05:48

    You get this error, because sc is not defined. I would try:

    sc = SparkContext(appName = "foo")
    

    Another thing that usually happens to me is not getting a Kerberos ticket in the cluster, because I forgot too.


    As for the "open issue in Spark" mentioned by Solnanki, I am pretty sure this is not the case any more.

提交回复
热议问题