我试图在spark-submit
中指定一个目录作为--files的参数。作业失败并显示以下消息:
org.apache.spark.SparkException: Added file file:[directory path] is a directory and recursive is not turned on.
spark-submit --help
中没有关于指定递归的内容,而谷歌搜索也没有显示它。有人知道吗?
答案 0 :(得分:2)
这与SPARK-16408有关。错误在this line处抛出,因为spark-submit调用addFile
,默认情况下递归设置为false。
作为一种解决方法,您应该单独指定每个文件,或者在运行时在SparkContext对象上调用addFile
,并将递归设置为true
sc.addFile(path = ..., recursive = true)