spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yhuai <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-10810] [SPARK-10902] [SQL] Improve sess...
Date Wed, 07 Oct 2015 18:06:10 GMT
Github user yhuai commented on a diff in the pull request:

    https://github.com/apache/spark/pull/8909#discussion_r41424269
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/SQLContext.scala ---
    @@ -64,18 +63,28 @@ import org.apache.spark.util.Utils
      *
      * @since 1.0.0
      */
    -class SQLContext(@transient val sparkContext: SparkContext)
    -  extends org.apache.spark.Logging
    -  with Serializable {
    +class SQLContext private[sql](
    +    @transient val sparkContext: SparkContext,
    +    @transient protected[sql] val cacheManager: CacheManager)
    +  extends org.apache.spark.Logging with Serializable {
     
       self =>
     
    +  def this(sparkContext: SparkContext) = this(sparkContext, new CacheManager)
       def this(sparkContext: JavaSparkContext) = this(sparkContext.sc)
     
       /**
    +   * Returns a SQLContext as new session, with separated SQL configurations, temporary
tables,
    +   * registered functions, but share the same SparkContext and CacheManager.
    +   */
    +  def newSession(): SQLContext = {
    +    new SQLContext(sparkContext, cacheManager)
    +  }
    +
    +  /**
        * @return Spark SQL configuration
        */
    -  protected[sql] def conf = currentSession().conf
    +  protected[sql] lazy val conf = new SQLConf
    --- End diff --
    
    Can we avoid of using `lazy val`?


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

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


Mime
View raw message