当我运行代码时
public class Square{
int area;
int id;
// other attributes
// constructor
public int getArea(){ // This method will return your square area
return this.area;
}
}
在spark-shell中它完美运作
val home = "/Users/adremja/Documents/Kaggle/outbrain"
val documents_categories = sc.textFile(home + "/documents_categories.csv")
documents_categories take(10) foreach println
然而,当我尝试在Zeppelin中运行时,我收到错误
scala> val home = "/Users/adremja/Documents/Kaggle/outbrain"
home: String = /Users/adremja/Documents/Kaggle/outbrain
scala> val documents_categories = sc.textFile(home + "/documents_categories.csv")
documents_categories: org.apache.spark.rdd.RDD[String] = /Users/adremja/Documents/Kaggle/outbrain/documents_categories.csv MapPartitionsRDD[21] at textFile at <console>:26
scala> documents_categories take(10) foreach println
document_id,category_id,confidence_level
1595802,1611,0.92
1595802,1610,0.07
1524246,1807,0.92
1524246,1608,0.07
1617787,1807,0.92
1617787,1608,0.07
1615583,1305,0.92
1615583,1806,0.07
1615460,1613,0.540646372
你知道问题出在哪里吗?
我从自制软件中获得了火花2.0.1(我在zeppelin-env.sh中将其作为SPARK_HOME链接起来)和来自Zeppelin网站的Zeppelin 0.6.2二进制文件。
答案 0 :(得分:6)
好吧,看起来我找到了解决方案。从zeppelin的lib文件夹我删除了:
并将其替换为Spark使用的2.6.5版本。
它现在有效,但我不知道我是不是破坏了其他任何东西。
答案 1 :(得分:1)