builder.
config
Sets a config option. Options set using this method are automatically propagated to both SparkConf and SparkSession’s own configuration.
SparkConf
SparkSession
New in version 2.0.0.
Changed in version 3.4.0: Supports Spark Connect.
a key name string for configuration property
a value for configuration property
an instance of SparkConf
a dictionary of configurations to set
New in version 3.4.0.
SparkSession.Builder
Examples
For an existing class:SparkConf, use conf parameter.
>>> from pyspark.conf import SparkConf >>> SparkSession.builder.config(conf=SparkConf()) <pyspark.sql.session.SparkSession.Builder...
For a (key, value) pair, you can omit parameter names.
>>> SparkSession.builder.config("spark.some.config.option", "some-value") <pyspark.sql.session.SparkSession.Builder...
Additionally, you can pass a dictionary of configurations to set.
>>> SparkSession.builder.config( ... map={"spark.some.config.number": 123, "spark.some.config.float": 0.123}) <pyspark.sql.session.SparkSession.Builder...