Skip to content

Commit

Permalink
Should fix issue teragrep#165
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 committed Jan 29, 2025
1 parent e233bda commit 08af5b7
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,9 @@ private String detectSparkScalaVersion(String sparkHome, Map<String, String> env
LOGGER.info("Detect scala version from SPARK_HOME: {}", sparkHome);
ProcessBuilder builder = new ProcessBuilder(sparkHome + "/bin/spark-submit", "--version");
builder.environment().putAll(env);
File processOutputFile = File.createTempFile("zeppelin-spark", ".out");
builder.redirectError(processOutputFile);
Process process = builder.start();
process.waitFor();
String processOutput = IOUtils.toString(new FileInputStream(processOutputFile), StandardCharsets.UTF_8);
String processOutput = IOUtils.toString(process.getErrorStream(), StandardCharsets.UTF_8);
Pattern pattern = Pattern.compile(".*Using Scala version (.*),.*");
Matcher matcher = pattern.matcher(processOutput);
if (matcher.find()) {
Expand Down

0 comments on commit 08af5b7

Please sign in to comment.