Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21468#discussion_r197971111
--- Diff:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
---
@@ -811,10 +811,18 @@ private[spark] class Client(
// Finally, update the Spark config to propagate PYTHONPATH to the AM
and executors.
if (pythonPath.nonEmpty) {
- val pythonPathStr = (sys.env.get("PYTHONPATH") ++ pythonPath)
+ val pythonPathStr = (sys.env.get("PYTHONPATH") ++=: pythonPath)
.mkString(ApplicationConstants.CLASS_PATH_SEPARATOR)
- env("PYTHONPATH") = pythonPathStr
- sparkConf.setExecutorEnv("PYTHONPATH", pythonPathStr)
+ val newValue =
--- End diff --
This seems unnecessary. What you're trying to do here is concatenate the
values of the current `PYTHONPATH` env variable, the `PYTHONPATH` created by
Spark, and the `PYTHONPATH` set in `spark.yarn.appMasterEnv`.
That's, respectively, `sys.env.get("PYTHONPATH")`, `pythonPath`, and
`env.get("PYTHONPATH")`. So just concatenate those.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]