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 @@ -91,7 +91,12 @@ public class PySparkInterpreter extends Interpreter implements ExecuteResultHand
public PySparkInterpreter(Properties property) {
super(property);

scriptPath = System.getProperty("java.io.tmpdir") + "/zeppelin_pyspark.py";
try {
File scriptFile = File.createTempFile("zeppelin_pyspark-", ".py");
scriptPath = scriptFile.getAbsolutePath();
} catch (IOException e) {
throw new InterpreterException(e);
}
}

private void createPythonScript() {
Expand Down Expand Up @@ -235,6 +240,7 @@ private int findRandomOpenPortOnAllLocalInterfaces() {
@Override
public void close() {
executor.getWatchdog().destroyProcess();
new File(scriptPath).delete();
gatewayServer.shutdown();
}

Expand Down
8 changes: 6 additions & 2 deletions spark/src/main/java/org/apache/zeppelin/spark/ZeppelinR.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,12 @@ public ZeppelinR(String rCmdPath, String libPath, int sparkRBackendPort) {
this.rCmdPath = rCmdPath;
this.libPath = libPath;
this.port = sparkRBackendPort;
scriptPath = System.getProperty("java.io.tmpdir") + "/zeppelin_sparkr.R";

try {
File scriptFile = File.createTempFile("zeppelin_sparkr-", ".R");
scriptPath = scriptFile.getAbsolutePath();
} catch (IOException e) {
throw new InterpreterException(e);
}
}

/**
Expand Down