无法从 Azure 上的 Spark 应用程序访问外部文件

Cannot access external file from spark application on azure

我有一个使用 maven 构建的 spark-streaming 应用程序。我正在使用 hdinsight 中头节点的 spark-submit 执行它。该应用程序使用外部配置文件。但它无法找到那些。我试过使用他们的本地路径、hdfs 路径和 blob 存储路径 (wasb)。但我无法让它工作。有人可以建议从应用程序引用外部文件的正确方法是什么吗?

这是一个例子:

/usr/hdp/current/spark2-client/bin/spark-submit 
--deploy-mode cluster 
--num-executors 1 
--files /home/sshuser/config.json,/home/sshuser/config2.json 
--class com.test.MyClass /home/sshuser/myApp.jar config.json

那么您就可以仅通过文件名来引用这些文件,例如:

def main(args: Array[String]): Unit = {

    val configurationFileLocation = args(0)

    ConfigProvider.setConfiguration(Utility.loadConfiguration(configurationFileLocation))