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