You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spark.apache.org by pw...@apache.org on 2014/04/16 17:54:37 UTC

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

Repository: spark
Updated Branches:
  refs/heads/master c0273d806 -> fec462c15


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 <li...@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


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/fec462c1
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/fec462c1
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/fec462c1

Branch: refs/heads/master
Commit: fec462c15321fa138d9654d64cc08468b6ab5ad1
Parents: c0273d8
Author: Cheng Lian <li...@gmail.com>
Authored: Wed Apr 16 08:54:34 2014 -0700
Committer: Patrick Wendell <pw...@gmail.com>
Committed: Wed Apr 16 08:54:34 2014 -0700

----------------------------------------------------------------------
 .../src/main/scala/org/apache/spark/sql/hive/TestHive.scala   | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/fec462c1/sql/hive/src/main/scala/org/apache/spark/sql/hive/TestHive.scala
----------------------------------------------------------------------
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/TestHive.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/TestHive.scala
index 444bbfb..b1a26fd 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/TestHive.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/TestHive.scala
@@ -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