错误:未找到:SC值 [英] error: not found: value sc
本文介绍了错误:未找到:SC值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我是新来的Scala,我试图code。使用以下code读取文件
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()
不过,我不断收到以下错误
But I keep getting the following error
error: not found: value sc
我已经试过一切,但似乎没有任何工作。我使用Scala版本2.10.4和星火1.1.0(我甚至试过星火1.2.0,但它不工作)。我已经SBT安装并编译但不能运行 SBT / SBT组装
。因为这是错误?
推荐答案
您使用应该用这个code ./火花壳
。这是斯卡拉REPL所提供sparkContext。您可以在文件夹的Apache火花分布发现它火花1.4.1 /斌
。
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
.
这篇关于错误:未找到:SC值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文