首页 > 解决方案 > Do spark tasks(per executor) share cache location?

问题描述

Do spark uses same cache location for storing tmp files per each executor

e.g., If I have two task running in one executor and both create a file with the same name, will one gives an error that "file exists"?

标签: apache-spark

解决方案


我从另一个来源得到答案,

它确实使用相同的缓存位置,根据它的 spark local dirs 属性,以及用于 java 东西的 io tmp dir,

如果通过创建文件您的意思是添加文件 (addFile),那么您可以通过将 spark.files.overwrite 设置为 true 来克服这个问题,这仅在当前文件与新添加的文件不同时才有效。


推荐阅读