public static class SparkSession.Builder
extends java.lang.Object
SparkSession.| Constructor and Description |
|---|
SparkSession.Builder() |
| Modifier and Type | Method and Description |
|---|---|
SparkSession.Builder |
appName(java.lang.String name)
Sets a name for the application, which will be shown in the Spark web UI.
|
SparkSession.Builder |
config(SparkConf conf)
Sets a list of config options based on the given
SparkConf. |
SparkSession.Builder |
config(java.lang.String key,
boolean value)
Sets a config option.
|
SparkSession.Builder |
config(java.lang.String key,
double value)
Sets a config option.
|
SparkSession.Builder |
config(java.lang.String key,
long value)
Sets a config option.
|
SparkSession.Builder |
config(java.lang.String key,
java.lang.String value)
Sets a config option.
|
SparkSession.Builder |
enableHiveSupport()
Enables Hive support, including connectivity to a persistent Hive metastore, support for
Hive serdes, and Hive user-defined functions.
|
SparkSession |
getOrCreate()
Gets an existing
SparkSession or, if there is no existing one, creates a new one
based on the options set in this builder. |
SparkSession.Builder |
master(java.lang.String master)
Sets the Spark master URL to connect to, such as "local" to run locally, "local[4]" to
run locally with 4 cores, or "spark://master:7077" to run on a Spark standalone cluster.
|
public SparkSession.Builder appName(java.lang.String name)
name - (undocumented)public SparkSession.Builder config(java.lang.String key, java.lang.String value)
SparkConf and SparkSession's own configuration.
key - (undocumented)value - (undocumented)public SparkSession.Builder config(java.lang.String key, long value)
SparkConf and SparkSession's own configuration.
key - (undocumented)value - (undocumented)public SparkSession.Builder config(java.lang.String key, double value)
SparkConf and SparkSession's own configuration.
key - (undocumented)value - (undocumented)public SparkSession.Builder config(java.lang.String key, boolean value)
SparkConf and SparkSession's own configuration.
key - (undocumented)value - (undocumented)public SparkSession.Builder config(SparkConf conf)
SparkConf.
conf - (undocumented)public SparkSession.Builder master(java.lang.String master)
master - (undocumented)public SparkSession.Builder enableHiveSupport()
public SparkSession getOrCreate()
SparkSession or, if there is no existing one, creates a new one
based on the options set in this builder.