Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Use classloader's getResource() function for reading resource files i…
…n HiveTests
  • Loading branch information
sameeragarwal committed Jun 3, 2016
commit 65fa0f6b39a9558c290d3ab9e6a223e65515ea8a
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,7 @@ private[hive] class TestHiveSparkSession(
hiveFilesTemp.mkdir()
ShutdownHookManager.registerShutdownDeleteDir(hiveFilesTemp)

val inRepoTests = if (System.getProperty("user.dir").endsWith("sql" + File.separator + "hive")) {
new File("src" + File.separator + "test" + File.separator + "resources" + File.separator)
} else {
new File("sql" + File.separator + "hive" + File.separator + "src" + File.separator + "test" +
File.separator + "resources")
}
val inRepoTests = new File(Thread.currentThread().getContextClassLoader.getResource(".").getFile)

def getHiveFile(path: String): File = {
val stripped = path.replaceAll("""\.\.\/""", "").replace('/', File.separatorChar)
Expand Down