我有一个数据帧(大约50 gb)和3个列表(每个元素有几百个元素,组合总数为445005)。
我需要检查列url中的值是否与3个列表中的任何组合匹配,并返回此组合。我是这样做的。
def checkMatch(query1:List[String], query2:List[String], model:List[String]):List[(String, String, String)]= {
for{
x <- query1
y <- query2
z <- model
if(url.contains(x) && url.contains(y) && url.contains(z))
} yield (x,y,z)
}在这个fails.As中,应用程序不会停止,但每个任务都会失败,并显示
ExecutorLostFailure (executor 26 exited unrelated to the running tasks) Reason: Container container on host: host was preempted.应用程序会一直运行,直到我终止它,没有任何任务完成。
我发现的关于这个错误的所有信息都表明内存不足。我的配置是
spark-submit \
--class Main \
--master yarn \
--deploy-mode client \
--num-executors 200 \
--executor-cores 10 \
--driver-memory 4G \
--executor-memory 8G \
--files hive-site.xml#hive-site.xml \
--conf spark.task.maxFailures=10 \
--conf spark.executor.memory=8G \
--conf spark.app.name=spark-job \
--conf spark.yarn.executor.memoryOverhead=4096 \
--conf spark.yarn.driver.memoryOverhead=2048 \
--conf spark.shuffle.service.enabled=true \
--conf spark.shuffle.consolidateFiles=true \
--conf spark.broadcast.compress=true \
--conf spark.shuffle.compress=true \
--conf spark.shuffle.spill.compress=true \
--conf spark.network.timeout=10000000 \
--conf spark.executor.heartbeatInterval=10000000 \我试着多分配2-3倍的内存。这没什么用。
还有其他的解决方案吗?实际上,内存不足是原因吗?
发布于 2018-05-31 02:11:59
这段代码发生在驱动程序上,因为您没有指定任何特殊的关键字,比如map或reduce,这就是为什么要花这么长时间的原因。这些列表可以被展平成一个列表,因为它们只是字符串?这将使map-reduce变得更容易。
https://stackoverflow.com/questions/50605873
复制相似问题