[英]Spark Kubernetes - FileNotFoundException when copying config files from driver to executors using --files or spark.files
[英]Spark: spark.files vs files
在文档中有带有文本的spark.files
:
Comma-separated list of files to be placed in the working directory of each executor. Globs are allowed.
它与spark-submit
的--files
是否相同?
我尝试将--conf spark.files
与#
一起使用来重命名,但似乎没有用。
有人知道吗?
您应该尝试使用spark.yarn.dist.files
属性
val spark = SparkSession
.builder()
.enableHiveSupport()
.getOrCreate()
SparkContext是在实例化spark对象时创建的。 在SparkContext实例化期间,如果将spark.files
属性配置为添加要下载到所有执行程序节点的文件,则会调用addFile
方法。
def addFile(path: String, recursive: Boolean): Unit = {
val uri = new Path(path).toUri
val schemeCorrectedPath = uri.getScheme match {
case null | "local" => new File(path).getCanonicalFile.toURI.toString
case _ => path
}
val hadoopPath = new Path(schemeCorrectedPath)
....
}
例如,如果路径值为localfile.txt#renamed.txt ,则hadoopPath转换为localfile.txt%23renamed.txt ,它将“#”之后的部分视为文件路径而不是片段。 因此它抛出FileNotFoundException。
通过--files, spark.yarn.dist.files
的deploy功能将片段正确处理的--files, spark.yarn.dist.files
指定的文件复制到执行程序节点中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.