spark :12: error: not found: value sc

后端 未结 7 860
北荒
北荒 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:52

    First check the log file after spark-shell command run whether SparkContext is initinalized as sc. if SparkContext is not initialized properly

    you have to set the IP address in spark environment.

    Open the env file in conf/spark.env.sh and add the below line

    export SPARK_LOCAL_IP="127.0.0.1"

    0 讨论(0)
提交回复
热议问题