pyspark.sql.SparkSession.builder.master

builder.master(master: str) → pyspark.sql.session.SparkSession.Builder

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.

New in version 2.0.0.

Parameters
masterstr

a url for spark master

Returns
SparkSession.Builder

Examples

>>> SparkSession.builder.master("local")
<pyspark.sql.session.SparkSession.Builder...