Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,6 @@ public void open() {
}

urls = urlList.toArray(urls);

ClassLoader oldCl = Thread.currentThread().getContextClassLoader();
try {
URLClassLoader newCl = new URLClassLoader(urls, oldCl);
Expand All @@ -169,11 +168,25 @@ public void open() {

private Map setupPySparkEnv() throws IOException{
Map env = EnvironmentUtils.getProcEnvironment();

if (!env.containsKey("PYTHONPATH")) {
SparkConf conf = getSparkConf();
env.put("PYTHONPATH", conf.get("spark.submit.pyFiles").replaceAll(",", ":") +
env.put("PYTHONPATH", conf.get("spark.submit.pyFiles").replaceAll(",", ":") +
":../interpreter/lib/python");
}

// get additional class paths when using SPARK_SUBMIT and not using YARN-CLIENT
// also, add all packages to PYTHONPATH since there might be transitive dependencies
if (SparkInterpreter.useSparkSubmit() &&
!getSparkInterpreter().isYarnMode()) {

String sparkSubmitJars = getSparkConf().get("spark.jars").replace(",", ":");

if (!"".equals(sparkSubmitJars)) {
env.put("PYTHONPATH", env.get("PYTHONPATH") + sparkSubmitJars);
}
}

return env;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ private DepInterpreter getDepInterpreter() {
return (DepInterpreter) p;
}

private boolean isYarnMode() {
public boolean isYarnMode() {
return getProperty("master").startsWith("yarn");
}

Expand Down Expand Up @@ -556,7 +556,7 @@ static final String toString(Object o) {
return (o instanceof String) ? (String) o : "";
}

private boolean useSparkSubmit() {
public static boolean useSparkSubmit() {
return null != System.getenv("SPARK_SUBMIT");
}

Expand Down Expand Up @@ -727,7 +727,6 @@ public void open() {
pathSettings.v_$eq(classpath);
settings.scala$tools$nsc$settings$ScalaSettings$_setter_$classpath_$eq(pathSettings);


// set classloader for scala compiler
settings.explicitParentLoader_$eq(new Some<>(Thread.currentThread()
.getContextClassLoader()));
Expand Down Expand Up @@ -976,7 +975,7 @@ public void populateSparkWebUrl(InterpreterContext ctx) {
}
}

private List<File> currentClassPath() {
public List<File> currentClassPath() {
List<File> paths = classPath(Thread.currentThread().getContextClassLoader());
String[] cps = System.getProperty("java.class.path").split(File.pathSeparator);
if (cps != null) {
Expand Down