首页 > 解决方案 > org.apache.spark.SparkException:作业因 pyspark 中的阶段失败而中止

问题描述

抱歉重复的帖子。我正在再次创建另一个帖子,因为这些帖子无法解决我的问题。我在 pyspark 3.0.1 上运行 ML 回归。我在 640 GB 内存和 32 个工作节点的集群上运行它。我有一个包含 33751 行和 63 列的数据集。我正在尝试为 ML 回归准备数据集。所以我写了以下代码

from pyspark.ml.feature import VectorAssembler, StandardScaler
input_col=[...]
vector_assembler=VectorAssembler(inputCols=input_col,outputCol='ss_feature')
temp_train=vector_assembler.transform(train)
standard_scaler=StandardScaler(inputCol='ss_feature',outputCol='scaled')
train=standard_scaler.fit(temp_train).transform(temp_train)

但我在最后一行执行时收到错误消息

org.apache.spark.SparkException: Job aborted due to stage failure: Task 169 in stage 57.0 failed 4 
times, most recent failure: Lost task 169.3 in stage 57.0 (TID 5522, 10.8.64.22, executor 11): 
org.apache.spark.SparkException: Failed to execute user defined 
function(VectorAssembler$$Lambda$6296/1890764576:

你能建议我如何解决这个问题吗?

标签: apache-sparkpysparkapache-spark-ml

解决方案


推荐阅读