Skip to content

[SPARK-45688][SPARK-45693][CORE] Clean up the deprecated API usage related to MapOps & Fix method += in trait Growable is deprecated #43578

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 14 additions & 14 deletions core/src/main/scala/org/apache/spark/deploy/SparkSubmit.scala
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@ private[spark] class SparkSubmit extends Logging {
if (opt.value != null &&
(deployMode & opt.deployMode) != 0 &&
(clusterManager & opt.clusterManager) != 0) {
if (opt.clOption != null) { childArgs += (opt.clOption, opt.value) }
if (opt.clOption != null) { childArgs += opt.clOption += opt.value }
if (opt.confKey != null) {
if (opt.mergeFn.isDefined && sparkConf.contains(opt.confKey)) {
sparkConf.set(opt.confKey, opt.mergeFn.get.apply(sparkConf.get(opt.confKey), opt.value))
Expand Down Expand Up @@ -747,15 +747,15 @@ private[spark] class SparkSubmit extends Logging {
if (args.isStandaloneCluster) {
if (args.useRest) {
childMainClass = REST_CLUSTER_SUBMIT_CLASS
childArgs += (args.primaryResource, args.mainClass)
childArgs += args.primaryResource += args.mainClass
} else {
// In legacy standalone cluster mode, use Client as a wrapper around the user class
childMainClass = STANDALONE_CLUSTER_SUBMIT_CLASS
if (args.supervise) { childArgs += "--supervise" }
Option(args.driverMemory).foreach { m => childArgs += ("--memory", m) }
Option(args.driverCores).foreach { c => childArgs += ("--cores", c) }
Option(args.driverMemory).foreach { m => childArgs += "--memory" += m }
Option(args.driverCores).foreach { c => childArgs += "--cores" += c }
childArgs += "launch"
childArgs += (args.master, args.primaryResource, args.mainClass)
childArgs += args.master += args.primaryResource += args.mainClass
}
if (args.childArgs != null) {
childArgs ++= args.childArgs
Expand All @@ -777,20 +777,20 @@ private[spark] class SparkSubmit extends Logging {
if (isYarnCluster) {
childMainClass = YARN_CLUSTER_SUBMIT_CLASS
if (args.isPython) {
childArgs += ("--primary-py-file", args.primaryResource)
childArgs += ("--class", "org.apache.spark.deploy.PythonRunner")
childArgs += "--primary-py-file" += args.primaryResource
childArgs += "--class" += "org.apache.spark.deploy.PythonRunner"
} else if (args.isR) {
val mainFile = new Path(args.primaryResource).getName
childArgs += ("--primary-r-file", mainFile)
childArgs += ("--class", "org.apache.spark.deploy.RRunner")
childArgs += "--primary-r-file" += mainFile
childArgs += "--class" += "org.apache.spark.deploy.RRunner"
} else {
if (args.primaryResource != SparkLauncher.NO_RESOURCE) {
childArgs += ("--jar", args.primaryResource)
childArgs += "--jar" += args.primaryResource
}
childArgs += ("--class", args.mainClass)
childArgs += "--class" += args.mainClass
}
if (args.childArgs != null) {
args.childArgs.foreach { arg => childArgs += ("--arg", arg) }
args.childArgs.foreach { arg => childArgs += "--arg" += arg }
}
}

Expand All @@ -813,12 +813,12 @@ private[spark] class SparkSubmit extends Logging {
}
if (args.childArgs != null) {
args.childArgs.foreach { arg =>
childArgs += ("--arg", arg)
childArgs += "--arg" += arg
}
}
// Pass the proxyUser to the k8s app so it is possible to add it to the driver args
if (args.proxyUser != null) {
childArgs += ("--proxy-user", args.proxyUser)
childArgs += "--proxy-user" += args.proxyUser
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,15 @@ object CommandUtils extends Logging {

var newEnvironment = if (libraryPathEntries.nonEmpty && libraryPathName.nonEmpty) {
val libraryPaths = libraryPathEntries ++ cmdLibraryPath ++ env.get(libraryPathName)
command.environment + ((libraryPathName, libraryPaths.mkString(File.pathSeparator)))
command.environment ++ Map(libraryPathName -> libraryPaths.mkString(File.pathSeparator))
} else {
command.environment
}

// set auth secret to env variable if needed
if (securityMgr.isAuthenticationEnabled()) {
newEnvironment += (SecurityManager.ENV_AUTH_SECRET -> securityMgr.getSecretKey())
newEnvironment = newEnvironment ++
Map(SecurityManager.ENV_AUTH_SECRET -> securityMgr.getSecretKey())
}
// set SSL env variables if needed
newEnvironment ++= securityMgr.getEnvironmentForSslRpcPasswords
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ class JsonProtocolSuite extends SparkFunSuite {
val expectedEvent: SparkListenerEnvironmentUpdate = {
val e = JsonProtocol.environmentUpdateFromJson(environmentUpdateJsonString)
e.copy(environmentDetails =
e.environmentDetails + ("Metrics Properties" -> Seq.empty[(String, String)]))
e.environmentDetails ++ Map("Metrics Properties" -> Seq.empty[(String, String)]))
}
val oldEnvironmentUpdateJson = environmentUpdateJsonString
.removeField("Metrics Properties")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private[spark] class YarnClientSchedulerBackend(
sc.ui.foreach { ui => conf.set(DRIVER_APP_UI_ADDRESS, ui.webUrl) }

val argsArrayBuf = new ArrayBuffer[String]()
argsArrayBuf += ("--arg", hostport)
argsArrayBuf += "--arg" += hostport

logDebug("ClientArguments called with: " + argsArrayBuf.mkString(" "))
val args = new ClientArguments(argsArrayBuf.toArray)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,12 @@ case class JoinEstimation(join: Join) extends Logging {
case _ =>
computeByNdv(leftKey, rightKey, newMin, newMax)
}
keyStatsAfterJoin += (
keyStatsAfterJoin +=
// Histograms are propagated as unchanged. During future estimation, they should be
// truncated by the updated max/min. In this way, only pointers of the histograms are
// propagated and thus reduce memory consumption.
leftKey -> joinStat.copy(histogram = leftKeyStat.histogram),
rightKey -> joinStat.copy(histogram = rightKeyStat.histogram)
)
(leftKey -> joinStat.copy(histogram = leftKeyStat.histogram)) +=
(rightKey -> joinStat.copy(histogram = rightKeyStat.histogram))
// Return cardinality estimated from the most selective join keys.
if (card < joinCard) joinCard = card
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ case class DescribeNamespaceExec(
}

if (isExtended) {
val properties = metadata.asScala -- CatalogV2Util.NAMESPACE_RESERVED_PROPERTIES
val properties = metadata.asScala.toMap -- CatalogV2Util.NAMESPACE_RESERVED_PROPERTIES
val propertiesStr =
if (properties.isEmpty) {
""
} else {
conf.redactOptions(properties.toMap).toSeq.sortBy(_._1).mkString("(", ", ", ")")
conf.redactOptions(properties).toSeq.sortBy(_._1).mkString("(", ", ", ")")
}
rows += toCatalystRow("Properties", propertiesStr)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,7 @@ class V2SessionCatalogNamespaceSuite extends V2SessionCatalogBaseSuite {
// remove location and comment that are automatically added by HMS unless they are expected
val toRemove =
CatalogV2Util.NAMESPACE_RESERVED_PROPERTIES.filter(expected.contains)
assert(expected -- toRemove === actual)
assert(expected.toMap -- toRemove === actual)
}

test("listNamespaces: basic behavior") {
Expand Down