spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zsxwing <...@git.apache.org>
Subject [GitHub] spark pull request #16826: Fork SparkSession with option to inherit a copy o...
Date Wed, 08 Feb 2017 23:38:45 GMT
Github user zsxwing commented on a diff in the pull request:

    https://github.com/apache/spark/pull/16826#discussion_r100190232
  
    --- Diff: sql/core/src/main/scala/org/apache/spark/sql/ExperimentalMethods.scala ---
    @@ -46,4 +48,23 @@ class ExperimentalMethods private[sql]() {
     
       @volatile var extraOptimizations: Seq[Rule[LogicalPlan]] = Nil
     
    +  /**
    +   * Get an identical copy of this `ExperimentalMethods` instance.
    +   * @note This is used when forking a `SparkSession`.
    +   * `clone` is provided here instead of implementing equivalent functionality
    +   * in `SparkSession.clone` since it needs to be updated
    +   * as the class `ExperimentalMethods` is extended or  modified.
    +   */
    +  override def clone: ExperimentalMethods = {
    +    def cloneSeq[T](seq: Seq[T]): Seq[T] = {
    +      val newSeq = new ListBuffer[T]
    +      newSeq ++= seq
    +      newSeq
    +    }
    +
    +    val result = new ExperimentalMethods
    +    result.extraStrategies = cloneSeq(extraStrategies)
    --- End diff --
    
    You don't need to copy these two `Seq`s since they are not mutable `Seq`s.


---
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