Skip to content

Commit d842309

Browse files
committed
Revert "Support both methods"
This reverts commit 4431daa.
1 parent 4431daa commit d842309

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -179,25 +179,19 @@ private[hive] class TestHiveSparkSession(
179179
hiveFilesTemp.mkdir()
180180
ShutdownHookManager.registerShutdownDeleteDir(hiveFilesTemp)
181181

182-
lazy val inRepoTests = {
183-
if (System.getProperty("user.dir").endsWith("sql" + File.separator + "hive")) {
184-
new File("src" + File.separator + "test" + File.separator + "resources" + File.separator)
185-
} else {
186-
new File("sql" + File.separator + "hive" + File.separator + "src" + File.separator + "test" +
187-
File.separator + "resources")
188-
}
182+
val inRepoTests = if (System.getProperty("user.dir").endsWith("sql" + File.separator + "hive")) {
183+
new File("src" + File.separator + "test" + File.separator + "resources" + File.separator)
184+
} else {
185+
new File("sql" + File.separator + "hive" + File.separator + "src" + File.separator + "test" +
186+
File.separator + "resources")
189187
}
190188

191189
def getHiveFile(path: String): File = {
192-
// Attempt to load from class loader, fall back to old system property based.
193-
val resourcePath = Option(Thread.currentThread().getContextClassLoader.getResource(path))
194-
resourcePath.map(rp => new File(rp.getFile)).getOrElse{
195-
val stripped = path.replaceAll("""\.\.\/""", "").replace('/', File.separatorChar)
196-
hiveDevHome
197-
.map(new File(_, stripped))
198-
.filter(_.exists)
199-
.getOrElse(new File(inRepoTests, stripped))
200-
}
190+
val stripped = path.replaceAll("""\.\.\/""", "").replace('/', File.separatorChar)
191+
hiveDevHome
192+
.map(new File(_, stripped))
193+
.filter(_.exists)
194+
.getOrElse(new File(inRepoTests, stripped))
201195
}
202196

203197
val describedTable = "DESCRIBE (\\w+)".r

0 commit comments

Comments
 (0)