Search in sources :

Example 1 with Builder

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;
}
Also used : SparkSession(org.apache.spark.sql.SparkSession) ParameterBuilder(org.apache.sysml.utils.ParameterBuilder) Builder(org.apache.spark.sql.SparkSession.Builder)

Aggregations

SparkSession (org.apache.spark.sql.SparkSession)1 Builder (org.apache.spark.sql.SparkSession.Builder)1 ParameterBuilder (org.apache.sysml.utils.ParameterBuilder)1