Repository: spark
Updated Branches:
  refs/heads/master ea4a3e7d0 -> 767522dc4


[SPARK-10786][SQL] Take the whole statement to generate the CommandProcessor

In the now implementation of `SparkSQLCLIDriver.scala`:
`val proc: CommandProcessor = CommandProcessorFactory.get(Array(tokens(0)), 
hconf)`
`CommandProcessorFactory` only take the first token of the statement, and this 
will be hard to diff the statement `delete jar xxx` and `delete from xxx`.
So maybe it's better to take the whole statement into the 
`CommandProcessorFactory`.

And in 
[HiveCommand](https://github.com/SaintBacchus/hive/blob/master/ql/src/java/org/apache/hadoop/hive/ql/processors/HiveCommand.java#L76),
 it already special handing these two statement.
```java
if(command.length > 1 && "from".equalsIgnoreCase(command[1])) {
  //special handling for SQL "delete from <table> where..."
  return null;
}
```

Author: huangzhaowei <[email protected]>

Closes #8895 from SaintBacchus/SPARK-10786.


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

Branch: refs/heads/master
Commit: 767522dc4e66dd26773d41d1576945187180d2b9
Parents: ea4a3e7
Author: huangzhaowei <[email protected]>
Authored: Mon Nov 2 21:31:10 2015 +0800
Committer: Cheng Lian <[email protected]>
Committed: Mon Nov 2 21:31:10 2015 +0800

----------------------------------------------------------------------
 .../org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/767522dc/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
----------------------------------------------------------------------
diff --git 
a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
 
b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
index 62e912c..6419002 100644
--- 
a/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
+++ 
b/sql/hive-thriftserver/src/main/scala/org/apache/spark/sql/hive/thriftserver/SparkSQLCLIDriver.scala
@@ -290,7 +290,7 @@ private[hive] class SparkSQLCLIDriver extends CliDriver 
with Logging {
     } else {
       var ret = 0
       val hconf = conf.asInstanceOf[HiveConf]
-      val proc: CommandProcessor = 
CommandProcessorFactory.get(Array(tokens(0)), hconf)
+      val proc: CommandProcessor = CommandProcessorFactory.get(tokens, hconf)
 
       if (proc != null) {
         // scalastyle:off println


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to