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

2014-04-16 Thread pwendell
Repository: spark
Updated Branches:
  refs/heads/branch-1.0 5fe18a74f - 9e908ab2e


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@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
(cherry picked from commit fec462c15321fa138d9654d64cc08468b6ab5ad1)

Signed-off-by: Patrick Wendell pwend...@gmail.com


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

Branch: refs/heads/branch-1.0
Commit: 9e908ab2ed5e7a58dd806fd0a79e53d83d124660
Parents: 5fe18a7
Author: Cheng Lian lian.cs@gmail.com
Authored: Wed Apr 16 08:54:34 2014 -0700
Committer: Patrick Wendell pwend...@gmail.com
Committed: Wed Apr 16 08:54:41 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/9e908ab2/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



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

2014-04-16 Thread pwendell
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 lian.cs@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 lian.cs@gmail.com
Authored: Wed Apr 16 08:54:34 2014 -0700
Committer: Patrick Wendell pwend...@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