我正在使用Zeppelin-Sandbox 0.5.6
with Spark 1.6.1
on Amazon EMR
。我正在阅读csv
位于s3
. 问题是有时我在读取文件时出错。我需要多次重新启动解释器,直到它工作。我的代码没有任何变化。我无法恢复它,也无法判断它何时发生。
我的代码如下:
定义依赖:
%dep
z.reset()
z.addRepo("Spark Packages Repo").url("http://dl.bintray.com/spark-packages/maven")
z.load("com.databricks:spark-csv_2.10:1.4.0")
使用spark-csv
:
%pyspark
import pyspark.sql.functions as func
df = sqlc.read.format("com.databricks.spark.csv").option("header", "true").load("s3://some_location/some_csv.csv")
错误信息:
Py4JJavaError: An error occurred while calling o61.load. :
org.apache.spark.SparkException: Job aborted due to stage failure:
Task 0 in stage 0.0 failed 4 times, most recent failure: Lost task 0.3
in stage 0.0 (TID 3, ip-172-22-2-187.ec2.internal):
java.io.InvalidClassException: com.databricks.spark.csv.CsvRelation;
local class incompatible: stream classdesc serialVersionUID =
2004612352657595167, local class serialVersionUID =
6879416841002809418
...
Caused by: java.io.InvalidClassException:
com.databricks.spark.csv.CsvRelation; local class incompatible
一旦我读csv
入dataframe
,其余代码就可以正常工作。
有什么建议吗?
谢谢!