Repository: spark
Updated Branches:
  refs/heads/master 383bf72c1 -> 51c816837


[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 <r...@apache.org>

Closes #1167 from rxin/commands and squashes the following commits:

56f04f8 [Reynold Xin] [SPARK-2227] Support dfs command in SQL.


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

Branch: refs/heads/master
Commit: 51c8168377a89d20d0b2d7b9a28af58593a0fe0c
Parents: 383bf72
Author: Reynold Xin <r...@apache.org>
Authored: Mon Jun 23 18:34:54 2014 -0700
Committer: Reynold Xin <r...@apache.org>
Committed: Mon Jun 23 18:34:54 2014 -0700

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/sql/hive/HiveQl.scala | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/51c81683/sql/hive/src/main/scala/org/apache/spark/sql/hive/HiveQl.scala
----------------------------------------------------------------------
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 b073dc3..b70104d 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("!")) {

Reply via email to