Skip to content

Commit

Permalink
Loads test tables when running "sbt hive/console" without HIVE_DEV_HOME
Browse files Browse the repository at this point in the history
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 <[email protected]>

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
  • Loading branch information
liancheng authored and pwendell committed Apr 16, 2014
1 parent c0273d8 commit fec462c
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fec462c

Please sign in to comment.