class_docstr: Lazy loading, memoizing, instantiation of SparkSessions.
  
  Useful when you want to defer SparkSession instantiation and provide access to the same
  instance throughout the application.
class_docstr_tok: ["Lazy","loading",",","memoizing",",","instantiation","of","SparkSessions",".","Useful","when","you","want","to","defer","SparkSession","instantiation","and","provide","access","to","the","same","instance","throughout","the","application","."]
docstr: Initialize the SparkSessionFactory.
  
  Args:
      environment_helper (EnvironmentHelper): A helper class to determine the current
          execution.
      spark_config (Dict[str, str]): The Spark configuration that will be passed to the
          initialization of Spark session.
docstr_tok: ["Initialize","the","SparkSessionFactory",".","Args",":","environment_helper","(","EnvironmentHelper",")",":","A","helper","class","to","determine","the","current","execution",".","spark_config","(","Dict","[","str",",","str","]",")",":","The","Spark","configuration","that","will","be","passed","to","the","initialization","of","Spark","session","."]
code: def __init__(
      self,
      environment_helper: EnvironmentHelper,
      spark_config: Dict[str, str] = None,
  ) -> None:
      """Initialize the SparkSessionFactory.
  
      Args:
          environment_helper (EnvironmentHelper): A helper class to determine the current
              execution.
          spark_config (Dict[str, str]): The Spark configuration that will be passed to the
              initialization of Spark session.
      """
      self.environment_helper = environment_helper
      self.spark_config = spark_config
  
file_path: sagemaker-python-sdk/src/sagemaker/feature_store/feature_processor/_spark_factory.py
imports: from __future__ import absolute_import
  from functools import lru_cache
  from typing import List, Tuple, Dict
  import feature_store_pyspark
  import feature_store_pyspark.FeatureStoreManager
  from pyspark.conf import SparkConf
  from pyspark.context import SparkContext
  from pyspark.sql import SparkSession
  from sagemaker.feature_store.feature_processor._env import EnvironmentHelper
label_desc: Use image node_id 1 to create a new SparkSessionFactory object  with example: obj = SparkSessionFactory(environment_helper, spark_config)