[JAVA-11122] Allow multiple contexts to prevent failing tests

This commit is contained in:
Haroon Khan 2022-05-11 12:59:11 +01:00
parent 39e01903c2
commit 3aacf5a5a8
2 changed files with 10 additions and 4 deletions

View File

@ -26,8 +26,11 @@ public class ActionsUnitTest {
@BeforeClass
public static void init() {
SparkConf conf = new SparkConf().setAppName("reduce")
.setMaster("local[*]");
SparkConf conf = new SparkConf()
.setAppName("reduce")
.setMaster("local[*]")
.set("spark.driver.allowMultipleContexts", "true");
sc = new JavaSparkContext(conf);
tourists = sc.textFile("data/Tourist.csv").filter(line -> !line.startsWith("Region"));
}

View File

@ -23,8 +23,11 @@ public class TransformationsUnitTest {
@BeforeClass
public static void init() {
SparkConf conf = new SparkConf().setAppName("uppercaseCountries")
.setMaster("local[*]");
SparkConf conf = new SparkConf()
.setAppName("uppercaseCountries")
.setMaster("local[*]")
.set("spark.driver.allowMultipleContexts", "true");
sc = new JavaSparkContext(conf);
tourists = sc.textFile("data/Tourist.csv")
.filter(line -> !line.startsWith("Region")); //filter header row