diff options
author | Reynold Xin <rxin@databricks.com> | 2016-04-20 17:56:31 -0700 |
---|---|---|
committer | Reynold Xin <rxin@databricks.com> | 2016-04-20 17:56:31 -0700 |
commit | 24f338ba7b34df493dd49bbc354d08f5e3afbb85 (patch) | |
tree | f44317480ee005aaa9b29a2ece29b2c24744ed06 /sql/hive/src/main/scala/org | |
parent | f47dbf27fa034629fab12d0f3c89ab75edb03f86 (diff) | |
download | spark-24f338ba7b34df493dd49bbc354d08f5e3afbb85.tar.gz spark-24f338ba7b34df493dd49bbc354d08f5e3afbb85.tar.bz2 spark-24f338ba7b34df493dd49bbc354d08f5e3afbb85.zip |
[SPARK-14775][SQL] Remove TestHiveSparkSession.rewritePaths
## What changes were proposed in this pull request?
The path rewrite in TestHiveSparkSession is pretty hacky. I think we can remove those complexity and just do a string replacement when we read the query files in. This would remove the overloading of runNativeSql in TestHive, which will simplify the removal of Hive specific variable substitution.
## How was this patch tested?
This is a small test refactoring to simplify test infrastructure.
Author: Reynold Xin <rxin@databricks.com>
Closes #12543 from rxin/SPARK-14775.
Diffstat (limited to 'sql/hive/src/main/scala/org')
-rw-r--r-- | sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala index e629099086..2bb13996c1 100644 --- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala +++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/test/TestHive.scala @@ -182,19 +182,6 @@ private[hive] class TestHiveSparkSession( Option(System.getenv(envVar)).map(new File(_)) } - /** - * Replaces relative paths to the parent directory "../" with hiveDevHome since this is how the - * hive test cases assume the system is set up. - */ - private[hive] def rewritePaths(cmd: String): String = - if (cmd.toUpperCase contains "LOAD DATA") { - val testDataLocation = - hiveDevHome.map(_.getCanonicalPath).getOrElse(inRepoTests.getCanonicalPath) - cmd.replaceAll("\\.\\./\\.\\./", testDataLocation + "/") - } else { - cmd - } - val hiveFilesTemp = File.createTempFile("catalystHiveFiles", "") hiveFilesTemp.delete() hiveFilesTemp.mkdir() @@ -566,11 +553,6 @@ private[hive] class TestHiveSessionState(sparkSession: TestHiveSparkSession) override def executePlan(plan: LogicalPlan): TestHiveQueryExecution = { new TestHiveQueryExecution(sparkSession, plan) } - - // Override so we can intercept relative paths and rewrite them to point at hive. - override def runNativeSql(sql: String): Seq[String] = { - super.runNativeSql(sparkSession.rewritePaths(substitutor.substitute(hiveconf, sql))) - } } |