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

    https://github.com/apache/spark/pull/8535#discussion_r39110325
  
    --- Diff: 
sql/core/src/test/scala/org/apache/spark/sql/execution/local/LocalNodeTest.scala
 ---
    @@ -17,13 +17,39 @@
     
     package org.apache.spark.sql.execution.local
     
    +import scala.reflect.runtime.universe.TypeTag
    +import scala.util.Try
     import scala.util.control.NonFatal
     
     import org.apache.spark.SparkFunSuite
    -import org.apache.spark.sql.{DataFrame, Row}
    -import org.apache.spark.sql.test.SQLTestUtils
    +import org.apache.spark.sql.{DataFrame, DataFrameHolder, Row, SQLConf}
    +import org.apache.spark.sql.test.{SharedSQLContext, SQLTestUtils}
     
    -class LocalNodeTest extends SparkFunSuite {
    +class LocalNodeTest extends SparkFunSuite with SharedSQLContext {
    +
    +  protected val conf = new SQLConf
    +
    +  /**
    +   * Sets all configurations specified in `pairs`, calls `f`, and then 
restore all configurations.
    +   */
    +  protected def withConf(pairs: (String, String)*)(f: => Unit): Unit = {
    +    val (keys, values) = pairs.unzip
    +    val currentValues = keys.map(key => 
Try(conf.getConfString(key)).toOption)
    +    (keys, values).zipped.foreach(conf.setConfString)
    +    try f finally {
    +      keys.zip(currentValues).foreach {
    +        case (key, Some(value)) => conf.setConfString(key, value)
    +        case (key, None) => conf.unsetConf(key)
    +      }
    +    }
    +  }
    +
    +  /**
    +   * Creates a DataFrame from a local Seq of Product.
    +   */
    +  implicit def localSeqToDataFrameHolder[A <: Product : TypeTag](data: 
Seq[A]): DataFrameHolder = {
    +    sqlContext.implicits.localSeqToDataFrameHolder(data)
    +  }
    --- End diff --
    
    same here, this is already available through `SQLTestUtils`


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