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

    https://github.com/apache/spark/pull/13380#discussion_r65469915
  
    --- 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 --
    
    Again, should we deprecate existing stuff?


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to