Github user jkbradley commented on a diff in the pull request:

    https://github.com/apache/spark/pull/13380#discussion_r65439185
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/util/ReadWrite.scala ---
    @@ -33,36 +33,34 @@ import org.apache.spark.ml.classification.{OneVsRest, 
OneVsRestModel}
     import org.apache.spark.ml.feature.RFormulaModel
     import org.apache.spark.ml.param.{ParamPair, Params}
     import org.apache.spark.ml.tuning.ValidatorParams
    -import org.apache.spark.sql.{SparkSession, SQLContext}
    +import org.apache.spark.sql.SparkSession
     import org.apache.spark.util.Utils
     
     /**
      * Trait for [[MLWriter]] and [[MLReader]].
      */
     private[util] sealed trait BaseReadWrite {
    -  private var optionSQLContext: Option[SQLContext] = None
    +  private var optionSparkSession: Option[SparkSession] = None
     
       /**
    -   * Sets the SQL context to use for saving/loading.
    +   * Sets the Spark Session to use for saving/loading.
        */
       @Since("1.6.0")
    -  def context(sqlContext: SQLContext): this.type = {
    -    optionSQLContext = Option(sqlContext)
    +  def context(sparkSession: SparkSession): this.type = {
    +    optionSparkSession = Option(sparkSession)
         this
       }
     
       /**
    -   * Returns the user-specified SQL context or the default.
    +   * Returns the user-specified Spark Session or the default.
        */
    -  protected final def sqlContext: SQLContext = {
    -    if (optionSQLContext.isEmpty) {
    -      optionSQLContext = 
Some(SQLContext.getOrCreate(SparkContext.getOrCreate()))
    +  protected final def sparkSession: SparkSession = {
    --- End diff --
    
    Same here; I'd keep both sqlContext and sparkSession.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to