Skip to content

Commit

Permalink
Should fix issue teragrep#165 (teragrep#170)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrongestNumber9 authored Feb 4, 2025
1 parent a32b62b commit 902643c
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 902643c

Please sign in to comment.