Skip to content

Commit

Permalink
Merge pull request #107 from jornfranke/main
Browse files Browse the repository at this point in the history
Fix: #66
  • Loading branch information
NicoLaval authored Feb 12, 2024
2 parents 1d4bd69 + bd9cc5f commit 0ffb93b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/fr/insee/trevas/jupyter/SparkUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,18 @@ public static SparkSession buildSparkSession() {
SparkConf conf = new SparkConf(true);
String spark_home = System.getenv("SPARK_HOME") + "/conf";
Path path = Path.of(spark_home, "spark-defaults.conf");
if (Files.exists(path)) {
if (Files.exists(path)) {
org.apache.spark.util.Utils.loadDefaultSparkProperties(conf, path.normalize().toAbsolutePath().toString());
if (conf.get("spark.jars","").equals("")) {
conf.set("spark.jars", String.join(",",
"/vtl-spark.jar",
"/vtl-model.jar",
"/vtl-parser.jar",
"/vtl-engine.jar"
));
org.apache.spark.util.Utils.loadDefaultSparkProperties(conf, path.normalize().toAbsolutePath().toString());
} else {
}
}
else {
sparkBuilder.master("local");
}
return sparkBuilder.config(conf).getOrCreate();
Expand Down

0 comments on commit 0ffb93b

Please sign in to comment.