Github user vanzin commented on a diff in the pull request:
https://github.com/apache/spark/pull/21476#discussion_r192814446
--- Diff:
resource-managers/yarn/src/main/scala/org/apache/spark/deploy/yarn/Client.scala
---
@@ -1485,6 +1486,22 @@ private object Client extends Logging {
YarnAppReport(report.getYarnApplicationState(),
report.getFinalApplicationStatus(), diagsOpt)
}
+ /**
+ * Create a properly quoted library path string to be added as a prefix
to the command executed by
+ * YARN. This is different from plain quoting due to YARN executing the
command through "bash -c".
+ */
+ def createLibraryPathPrefix(libpath: String, conf: SparkConf): String = {
+ val cmdPrefix = if (Utils.isWindows) {
+ Utils.libraryPathEnvPrefix(Seq(libpath))
+ } else {
+ val envName = Utils.libraryPathEnvName
+ // For quotes, escape both the quote and the escape character when
encoding in the command
+ // string.
+ val quoted = libpath.replace("\"", "\\\\\\\"")
--- End diff --
This needs to be double escaped because it goes through two rounds of bash
interpreting the value.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]