【发布时间】:2017-01-16 10:52:35
【问题描述】:
我正在尝试读取我创建的 Spark DataFrame 的第一行,如下所示:
#read file
datasetDF = sqlContext.read.format('com.databricks.spark.csv').options(delimiter=';', header='true',inferschema='true').load(dataset)
#vectorize
ignore = ['value']
vecAssembler = VectorAssembler(inputCols=[x for x in datasetDF.columns if x not in ignore], outputCol="features")
#split training - test set
(split20DF, split80DF) = datasetDF.randomSplit([1.0, 4.0],seed)
testSetDF = split20DF.cache()
trainingSetDF = split80DF.cache()
print trainingSetDF.take(5)
但是,如果我运行此代码,我会收到以下错误(由最后一行 print trainingSetDF.take(5) 引起):
: org.apache.spark.SparkException: Job aborted due to stage failure:
Task 0 in stage 3.0 failed 4 times, most recent failure:
Lost task 0.3 in stage 3.0 (TID 7, 192.168.101.102): java.util.concurrent.ExecutionException: java.lang.Exception: failed to compile:
org.codehaus.janino.JaninoRuntimeException:
Code of method "
(Lorg/apache/spark/sql/catalyst/InternalRow;Lorg/apache/spark/sql/catalyst/InternalRow;)I" of class
**"org.apache.spark.sql.catalyst.expressions.GeneratedClass$SpecificOrdering" grows beyond 64 KB**
我需要补充一点,只有当我拥有相当多的功能(超过 256 个)时才会发生这种情况。 我做错了什么?
谢谢, 弗洛伦特
【问题讨论】:
标签: python apache-spark pyspark spark-dataframe