Skip to content
Snippets Groups Projects
Commit 51c81683 authored by Reynold Xin's avatar Reynold Xin
Browse files

[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.
parent 383bf72c
No related branches found
No related tags found
No related merge requests found
...@@ -38,8 +38,6 @@ import scala.collection.JavaConversions._ ...@@ -38,8 +38,6 @@ import scala.collection.JavaConversions._
*/ */
private[hive] case object NativePlaceholder extends Command 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 ShellCommand(cmd: String) extends Command
private[hive] case class SourceCommand(filePath: String) extends Command private[hive] case class SourceCommand(filePath: String) extends Command
...@@ -227,15 +225,15 @@ private[hive] object HiveQl { ...@@ -227,15 +225,15 @@ private[hive] object HiveQl {
SetCommand(Some(key), Some(value)) SetCommand(Some(key), Some(value))
} }
} else if (sql.trim.toLowerCase.startsWith("cache table")) { } 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")) { } 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")) { } 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")) { } else if (sql.trim.toLowerCase.startsWith("add file")) {
AddFile(sql.drop(9)) AddFile(sql.trim.drop(9))
} else if (sql.trim.startsWith("dfs")) { } else if (sql.trim.toLowerCase.startsWith("dfs")) {
DfsCommand(sql) NativeCommand(sql)
} else if (sql.trim.startsWith("source")) { } else if (sql.trim.startsWith("source")) {
SourceCommand(sql.split(" ").toSeq match { case Seq("source", filePath) => filePath }) SourceCommand(sql.split(" ").toSeq match { case Seq("source", filePath) => filePath })
} else if (sql.trim.startsWith("!")) { } else if (sql.trim.startsWith("!")) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment