newBuilder: (SparkSession, Option[SessionState]) => BaseSessionStateBuilderBaseSessionStateBuilder — Generic Builder of SessionState
BaseSessionStateBuilder is the abstraction of builders that can produce a new BaseSessionStateBuilder to create a SessionState.
| Note | BaseSessionStateBuilderand spark.sql.catalogImplementation configuration property allow for Hive and non-Hive Spark deployments. | 
| Method | Description | 
|---|---|
| 
 | Produces a new  Used when  | 
BaseSessionStateBuilder is created when SparkSession is requested for a SessionState.
scala> :type spark
org.apache.spark.sql.SparkSession
scala> :type spark.sessionState
org.apache.spark.sql.internal.SessionStateBaseSessionStateBuilder holds properties that (together with newBuilder) are used to create a SessionState.
| Name | Description | ||
|---|---|---|---|
| 
 | |||
| 
 | Used to create Analyzer, Optimizer and a SessionState itself 
 | ||
| 
 | |||
| 
 | Custom operator optimization rules to add to the base Operator Optimization batch. When requested for the custom rules,  | ||
| 
 | |||
| 
 | |||
| 
 | |||
| 
 | |||
| 
 | SparkOptimizer (that is downcast to the base Optimizer) that is created with the SessionCatalog and the ExperimentalMethods. Note that the  
 | ||
| 
 | |||
| 
 | |||
| 
 | |||
| 
 | |||
| 
 | 
| BaseSessionStateBuilder | Description | 
|---|---|
| Note | 
  | 
| Note | BaseSessionStateBuilderis an experimental and unstable API. | 
Creating BaseSessionStateBuilder Instance
BaseSessionStateBuilder takes the following to be created:
- 
Optional SessionState 
 Creating Clone of SessionState (Lazily) — createClone Method
createClone: (SparkSession, SessionState) => SessionStatecreateClone creates a SessionState (lazily as a function) using newBuilder followed by build.
| Note | createCloneis used whenBaseSessionStateBuilderis requested for a SessionState. | 
 Creating SessionState — build Method
build(): SessionStatebuild creates a SessionState with the following:
| Note | 
 
 | 
 Getting Function to Create QueryExecution For LogicalPlan — createQueryExecution Method
createQueryExecution: LogicalPlan => QueryExecutioncreateQueryExecution simply returns a function that takes a LogicalPlan and creates a QueryExecution with the SparkSession and the logical plan.
| Note | createQueryExecutionis used exclusively whenBaseSessionStateBuilderis requested to create a SessionState instance. |