05c6b8acdc
### What changes were proposed in this pull request? This PR changes `SparkBuild.scala` to edit `config.properties` in `yarn` sub-module in build with SBT like as build with Maven does. ### Why are the changes needed? yarn sub-module contains config.properties. ``` spark.yarn.isHadoopProvided = ${spark.yarn.isHadoopProvided} ``` The `${spark.yarn.isHadoopProvided}` part is replaced with `true` or `false` in build depending on whether Hadoop is provided or not (specified by -Phadoop-provided). The edited config.properties will be loaded at runtime to control how to populate Hadoop-related classpath. If we build with Maven, these process works but doesn't with SBT. If we build with SBT and deploy apps on YARN, the following warning appears and classpath is not populated correctly. ``` 21/06/29 10:51:20 WARN config.package: Can not load the default value of `spark.yarn.isHadoopProvided` from `org/apache/spark/deploy/yarn/config.properties` with error, java.lang.IllegalArgumentException: For input string: "${spark.yarn.isHadoopProvided}". Using `false` as a default value. ``` ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Built with SBT and extracted `config.properties` from the build artifact and confirmed `${spark.yarn.isHadoopProvided} was correctly edited with `true` or `false`. ``` cat org/apache/spark/deploy/yarn/config.properties spark.yarn.isHadoopProvided = false # In case build with -Pyarn and without -Phadoop-provided spark.yarn.isHadoopProvided = true # In case build with -Pyarn and -Phadoop-provided ``` I also confirmed the warning message shown above no longer appears. Closes #33121 from sarutak/sbt-yarn-config-properties. Authored-by: Kousuke Saruta <sarutak@oss.nttdata.com> Signed-off-by: DB Tsai <d_tsai@apple.com> |
||
---|---|---|
.. | ||
build.properties | ||
MimaBuild.scala | ||
MimaExcludes.scala | ||
plugins.sbt | ||
SparkBuild.scala |