File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
src/main/scala/za/co/absa/hyperdrive/trigger/scheduler/executors/spark Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -74,7 +74,7 @@ class SparkYarnClusterServiceImpl @Inject()(
7474 .setAppResource(jobParameters.jobJar)
7575 .setAppName(jobName)
7676 .setConf(" spark.yarn.tags" , id)
77- .addAppArgs(jobParameters.appArguments.toSeq:_* )
77+ .addAppArgs(jobParameters.appArguments.toSeq.map(fix_json_for_yarn) :_* )
7878 .addSparkArg(" --verbose" )
7979 config.filesToDeploy.foreach(file => sparkLauncher.addFile(file))
8080 config.additionalConfs.foreach(conf => sparkLauncher.setConf(conf._1, conf._2))
@@ -86,4 +86,13 @@ class SparkYarnClusterServiceImpl @Inject()(
8686
8787 sparkLauncher
8888 }
89+
90+ /*
91+ Fixed inspired by https://stackoverflow.com/questions/43040793/scala-via-spark-with-yarn-curly-brackets-string-missing
92+ See https://issues.apache.org/jira/browse/SPARK-17814
93+ Due to YARN bug above, we need to replace all occurrences of {{ or }}, with { { or } }
94+ */
95+ private def fix_json_for_yarn (arg : String ): String = {
96+ arg.replace(" }}" , " } }" ).replace(" {{" , " { {" )
97+ }
8998}
You can’t perform that action at this time.
0 commit comments