我正在使用 import cucumber.api.cli.Main
方法调用 cucumber 主方法如
Main.main(
Array(glue,gluePath,tag,tagName,plugin,pluginNameAndPath,
"hdfs:///user/test/hdfs.feature"))
在使用本地路径时,是否可以从hdfs位置读取功能文件?
读取hdfs路径的方法是
val fs = FileSystem.get(new Configuration());
val fsDataInputStream = fs.open(new Path("/user/test/hdfs.feature"))
我也可以将其转换为输入流,但问题是array()只接受字符串,hdfs reader返回输入流和文件系统。这个问题有解决办法吗?
更多参考-当我使用“spark submit--master yarn--deploy mode cluster”时,这个问题就存在了。
对于“spark submit--master yarn--deploy mode client”,它工作得很好。
1条答案
按热度按时间zbsbpyhn1#
下面是我的问题的答案,提供所有特性文件,使用
使用添加代码中的所有文件
然后通过sparkfiles在数组中使用。得到如下结果: