[JAVA-11122] Allow multiple contexts to prevent failing tests
This commit is contained in:
parent
39e01903c2
commit
3aacf5a5a8
@ -26,8 +26,11 @@ public class ActionsUnitTest {
|
|||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void init() {
|
public static void init() {
|
||||||
SparkConf conf = new SparkConf().setAppName("reduce")
|
SparkConf conf = new SparkConf()
|
||||||
.setMaster("local[*]");
|
.setAppName("reduce")
|
||||||
|
.setMaster("local[*]")
|
||||||
|
.set("spark.driver.allowMultipleContexts", "true");
|
||||||
|
|
||||||
sc = new JavaSparkContext(conf);
|
sc = new JavaSparkContext(conf);
|
||||||
tourists = sc.textFile("data/Tourist.csv").filter(line -> !line.startsWith("Region"));
|
tourists = sc.textFile("data/Tourist.csv").filter(line -> !line.startsWith("Region"));
|
||||||
}
|
}
|
||||||
|
@ -23,8 +23,11 @@ public class TransformationsUnitTest {
|
|||||||
|
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void init() {
|
public static void init() {
|
||||||
SparkConf conf = new SparkConf().setAppName("uppercaseCountries")
|
SparkConf conf = new SparkConf()
|
||||||
.setMaster("local[*]");
|
.setAppName("uppercaseCountries")
|
||||||
|
.setMaster("local[*]")
|
||||||
|
.set("spark.driver.allowMultipleContexts", "true");
|
||||||
|
|
||||||
sc = new JavaSparkContext(conf);
|
sc = new JavaSparkContext(conf);
|
||||||
tourists = sc.textFile("data/Tourist.csv")
|
tourists = sc.textFile("data/Tourist.csv")
|
||||||
.filter(line -> !line.startsWith("Region")); //filter header row
|
.filter(line -> !line.startsWith("Region")); //filter header row
|
||||||
|
Loading…
x
Reference in New Issue
Block a user