use of org.apache.spark.sql.SparkSession.Builder in project incubator-systemml by apache.
the class AutomatedTestBase method createSystemMLSparkSession.
/**
* Create a SystemML-preferred Spark Session.
*
* @param appName the application name
* @param master the master value (ie, "local", etc)
* @return Spark Session
*/
public static SparkSession createSystemMLSparkSession(String appName, String master) {
Builder builder = SparkSession.builder();
if (appName != null) {
builder.appName(appName);
}
if (master != null) {
builder.master(master);
}
builder.config("spark.driver.maxResultSize", "0");
if (SparkExecutionContext.FAIR_SCHEDULER_MODE) {
builder.config("spark.scheduler.mode", "FAIR");
}
builder.config("spark.locality.wait", "5s");
SparkSession spark = builder.getOrCreate();
return spark;
}
Aggregations