Share via


SparkSession.NewSession Method

Definition

Start a new session with isolated SQL configurations, temporary tables, registered functions are isolated, but sharing the underlying SparkContext and cached data.

public Microsoft.Spark.Sql.SparkSession NewSession ();
member this.NewSession : unit -> Microsoft.Spark.Sql.SparkSession
Public Function NewSession () As SparkSession

Returns

New SparkSession object

Remarks

Other than the SparkContext, all shared state is initialized lazily. This method will force the initialization of the shared state to ensure that parent and child sessions are set up with the same shared state. If the underlying catalog implementation is Hive, this will initialize the metastore, which may take some time.

Applies to