aboutsummaryrefslogtreecommitdiff
path: root/sql/hive
diff options
context:
space:
mode:
authorReynold Xin <rxin@apache.org>2014-06-23 18:34:54 -0700
committerReynold Xin <rxin@apache.org>2014-06-23 18:35:10 -0700
commitc43835305bcc5498a8543688547b92f431498c25 (patch)
tree3ec359a313081dae1da6669c9accc6c47228ec71 /sql/hive
parent6d821f0c073829ed6b89bd184f6f41ee95d8fdec (diff)
downloadspark-c43835305bcc5498a8543688547b92f431498c25.tar.gz
spark-c43835305bcc5498a8543688547b92f431498c25.tar.bz2
spark-c43835305bcc5498a8543688547b92f431498c25.zip
[SPARK-2227] Support dfs command in SQL.
Note that nothing gets printed to the console because we don't properly maintain session state right now. I will have a followup PR that fixes it. Author: Reynold Xin <rxin@apache.org> Closes #1167 from rxin/commands and squashes the following commits: 56f04f8 [Reynold Xin] [SPARK-2227] Support dfs command in SQL. (cherry picked from commit 51c8168377a89d20d0b2d7b9a28af58593a0fe0c) Signed-off-by: Reynold Xin <rxin@apache.org>
Diffstat (limited to 'sql/hive')
-rw-r--r--sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala14
1 files changed, 6 insertions, 8 deletions
diff --git a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
index b073dc3895..b70104dd5b 100644
--- a/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
+++ b/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
@@ -38,8 +38,6 @@ import scala.collection.JavaConversions._
*/
private[hive] case object NativePlaceholder extends Command
-private[hive] case class DfsCommand(cmd: String) extends Command
-
private[hive] case class ShellCommand(cmd: String) extends Command
private[hive] case class SourceCommand(filePath: String) extends Command
@@ -227,15 +225,15 @@ private[hive] object HiveQl {
SetCommand(Some(key), Some(value))
}
} else if (sql.trim.toLowerCase.startsWith("cache table")) {
- CacheCommand(sql.drop(12).trim, true)
+ CacheCommand(sql.trim.drop(12).trim, true)
} else if (sql.trim.toLowerCase.startsWith("uncache table")) {
- CacheCommand(sql.drop(14).trim, false)
+ CacheCommand(sql.trim.drop(14).trim, false)
} else if (sql.trim.toLowerCase.startsWith("add jar")) {
- AddJar(sql.drop(8))
+ AddJar(sql.trim.drop(8))
} else if (sql.trim.toLowerCase.startsWith("add file")) {
- AddFile(sql.drop(9))
- } else if (sql.trim.startsWith("dfs")) {
- DfsCommand(sql)
+ AddFile(sql.trim.drop(9))
+ } else if (sql.trim.toLowerCase.startsWith("dfs")) {
+ NativeCommand(sql)
} else if (sql.trim.startsWith("source")) {
SourceCommand(sql.split(" ").toSeq match { case Seq("source", filePath) => filePath })
} else if (sql.trim.startsWith("!")) {