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

    https://github.com/apache/spark/pull/16766#discussion_r99286957
  
    --- Diff: sql/core/src/test/scala/org/apache/spark/sql/DatasetSuite.scala 
---
    @@ -17,24 +17,41 @@
     
     package org.apache.spark.sql
     
    -import java.io.{Externalizable, ObjectInput, ObjectOutput}
    +import java.io.{Externalizable, File, ObjectInput, ObjectOutput}
     import java.sql.{Date, Timestamp}
     
    +import org.apache.hadoop.mapred.FileSplit
    +import org.scalatest.BeforeAndAfter
    +
    +import org.apache.spark.rdd.{CoalescedRDDPartition, HadoopPartition, 
SizeBasedCoalescer}
     import org.apache.spark.sql.catalyst.encoders.{OuterScopes, RowEncoder}
     import org.apache.spark.sql.catalyst.util.sideBySide
    -import org.apache.spark.sql.execution.{LogicalRDD, RDDScanExec, SortExec}
    +import org.apache.spark.sql.execution.{LogicalRDD, RDDScanExec}
     import org.apache.spark.sql.execution.exchange.{BroadcastExchangeExec, 
ShuffleExchange}
     import org.apache.spark.sql.execution.streaming.MemoryStream
     import org.apache.spark.sql.functions._
     import org.apache.spark.sql.test.SharedSQLContext
     import org.apache.spark.sql.types._
    +import org.apache.spark.util.Utils
     
     case class TestDataPoint(x: Int, y: Double, s: String, t: TestDataPoint2)
     case class TestDataPoint2(x: Int, s: String)
     
    -class DatasetSuite extends QueryTest with SharedSQLContext {
    +class DatasetSuite extends QueryTest with SharedSQLContext with 
BeforeAndAfter {
       import testImplicits._
     
    +  private var path: File = null
    +
    +  override def beforeAll(): Unit = {
    +    super.beforeAll()
    +    path = Utils.createTempDir()
    +    path.delete()
    +  }
    +
    +  after {
    +    Utils.deleteRecursively(path)
    +  }
    --- End diff --
    
    No need to do it, if you use `withTempPath`. 
[This](https://github.com/apache/spark/blob/master/sql/core/src/test/scala/org/apache/spark/sql/execution/command/DDLSuite.scala#L247-L265)
 is an example


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