{"action":"created","issue":{"url":"https://api.github.com/repos/apache/spark/issues/8895","labels_url":"https://api.github.com/repos/apache/spark/issues/8895/labels{/name}","comments_url":"https://api.github.com/repos/apache/spark/issues/8895/comments","events_url":"https://api.github.com/repos/apache/spark/issues/8895/events","html_url":"https://github.com/apache/spark/pull/8895","id":108043677,"number":8895,"title":"[SPARK-10786][SQL]Take the whole statement to generate the CommandProcessor","user":{"login":"SaintBacchus","id":7404824,"avatar_url":"https://avatars.githubusercontent.com/u/7404824?v=3","gravatar_id":"","url":"https://api.github.com/users/SaintBacchus","html_url":"https://github.com/SaintBacchus","followers_url":"https://api.github.com/users/SaintBacchus/followers","following_url":"https://api.github.com/users/SaintBacchus/following{/other_user}","gists_url":"https://api.github.com/users/SaintBacchus/gists{/gist_id}","starred_url":"https://api.github.com/users/SaintBacchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaintBacchus/subscriptions","organizations_url":"https://api.github.com/users/SaintBacchus/orgs","repos_url":"https://api.github.com/users/SaintBacchus/repos","events_url":"https://api.github.com/users/SaintBacchus/events{/privacy}","received_events_url":"https://api.github.com/users/SaintBacchus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-24T02:26:23Z","updated_at":"2015-10-08T01:44:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/apache/spark/pulls/8895","html_url":"https://github.com/apache/spark/pull/8895","diff_url":"https://github.com/apache/spark/pull/8895.diff","patch_url":"https://github.com/apache/spark/pull/8895.patch"},"body":"In the now implementation of `SparkSQLCLIDriver.scala`: \r\n`val proc: CommandProcessor = CommandProcessorFactory.get(Array(tokens(0)), hconf)`\r\n`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`.\r\nSo maybe it's better to take the whole statement into the `CommandProcessorFactory`.\r\n\r\nAnd 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.\r\n```java\r\nif(command.length > 1 && \"from\".equalsIgnoreCase(command[1])) {\r\n  //special handling for SQL \"delete from <table> where...\"\r\n  return null;\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/apache/spark/issues/comments/146390491","html_url":"https://github.com/apache/spark/pull/8895#issuecomment-146390491","issue_url":"https://api.github.com/repos/apache/spark/issues/8895","id":146390491,"user":{"login":"SaintBacchus","id":7404824,"avatar_url":"https://avatars.githubusercontent.com/u/7404824?v=3","gravatar_id":"","url":"https://api.github.com/users/SaintBacchus","html_url":"https://github.com/SaintBacchus","followers_url":"https://api.github.com/users/SaintBacchus/followers","following_url":"https://api.github.com/users/SaintBacchus/following{/other_user}","gists_url":"https://api.github.com/users/SaintBacchus/gists{/gist_id}","starred_url":"https://api.github.com/users/SaintBacchus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SaintBacchus/subscriptions","organizations_url":"https://api.github.com/users/SaintBacchus/orgs","repos_url":"https://api.github.com/users/SaintBacchus/repos","events_url":"https://api.github.com/users/SaintBacchus/events{/privacy}","received_events_url":"https://api.github.com/users/SaintBacchus/received_events","type":"User","site_admin":false},"created_at":"2015-10-08T01:44:58Z","updated_at":"2015-10-08T01:44:58Z","body":"@liancheng Can you take a look at this small change?"}}