Skip to content

Commit

Permalink
[SPARK-31238][SPARK-31284][TEST][FOLLOWUP]
Browse files Browse the repository at this point in the history
  • Loading branch information
dongjoon-hyun committed Mar 28, 2020
1 parent c4e98c0 commit 39c07a2
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import java.io.File
import scala.reflect.ClassTag
import scala.reflect.runtime.universe.TypeTag

import org.apache.commons.io.FileUtils
import org.scalatest.BeforeAndAfterAll

import org.apache.spark.sql._
Expand Down Expand Up @@ -136,6 +137,10 @@ abstract class OrcTest extends QueryTest with FileBasedDataSourceTest with Befor

protected def readResourceOrcFile(name: String): DataFrame = {
val url = Thread.currentThread().getContextClassLoader.getResource(name)
spark.read.orc(url.toString)
// Copy to avoid URISyntaxException when `sql/hive` accesses the resources in `sql/core`
val file = File.createTempFile("orc-test", ".orc")
file.deleteOnExit();
FileUtils.copyURLToFile(url, file)
spark.read.orc(file.getAbsolutePath)
}
}

0 comments on commit 39c07a2

Please sign in to comment.