Skip to content
Snippets Groups Projects
Commit fec462c1 authored by Cheng Lian's avatar Cheng Lian Committed by Patrick Wendell
Browse files

Loads test tables when running "sbt hive/console" without HIVE_DEV_HOME

When running Hive tests, the working directory is `$SPARK_HOME/sql/hive`, while when running `sbt hive/console`, it becomes `$SPARK_HOME`, and test tables are not loaded if `HIVE_DEV_HOME` is not defined.

Author: Cheng Lian <lian.cs.zju@gmail.com>

Closes #417 from liancheng/loadTestTables and squashes the following commits:

7cea8d6 [Cheng Lian] Loads test tables when running "sbt hive/console" without HIVE_DEV_HOME
parent c0273d80
No related branches found
No related tags found
No related merge requests found
......@@ -99,7 +99,12 @@ class TestHiveContext(sc: SparkContext) extends LocalHiveContext(sc) {
hiveFilesTemp.delete()
hiveFilesTemp.mkdir()
val inRepoTests = new File("src/test/resources/")
val inRepoTests = if (System.getProperty("user.dir").endsWith("sql/hive")) {
new File("src/test/resources/")
} else {
new File("sql/hive/src/test/resources")
}
def getHiveFile(path: String): File = {
val stripped = path.replaceAll("""\.\.\/""", "")
hiveDevHome
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment