error: not found: value sc

后端 未结 1 601
抹茶落季
抹茶落季 2021-01-13 05:58

I am new to Scala and am trying to code read a file using the following code

scala> val textFile = sc.textFile(\"README.md\")
scala> textFile.count()
<         


        
1条回答
  •  隐瞒了意图╮
    2021-01-13 06:21

    You should run this code using ./spark-shell. It's scala repl with provided sparkContext. You can find it in your apache spark distribution in folder spark-1.4.1/bin.

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