Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
sunchao committed May 22, 2024
1 parent 6be3560 commit 6c5861b
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,22 @@ private[deploy] class SparkSubmitArguments(args: Seq[String], env: Map[String, S
*/
private def mergeDefaultSparkProperties(): Unit = {
// Use common defaults file, if not specified by user
propertiesFile = Option(propertiesFile).getOrElse(Utils.getDefaultPropertiesFile(env))
// Honor --conf before the defaults file
defaultSparkProperties.foreach { case (k, v) =>
if (!sparkProperties.contains(k)) {
sparkProperties(k) = v
}
}

// Also load properties from `spark-defaults.conf` if they do not exist in the properties file
Option(Utils.getDefaultPropertiesFile(env)).foreach { filename =>
val properties = Utils.getPropertiesFromFile(filename)
properties.foreach { case (k, v) =>
if (!sparkProperties.contains(k)) {
sparkProperties(k) = v
}
}
}
}

/**
Expand Down

0 comments on commit 6c5861b

Please sign in to comment.