[SPARK-2594][SQL] Support CACHE TABLE <name> AS SELECT ...

This feature allows user to add cache table from the select query.
Example : ```CACHE TABLE testCacheTable AS SELECT * FROM TEST_TABLE```
Spark takes this type of SQL as command and it does lazy caching just like ```SQLContext.cacheTable```, ```CACHE TABLE <name>``` does.
It can be executed from both SQLContext and HiveContext.

Recreated the pull request after rebasing with master.And fixed all the comments raised in previous pull requests.
https://github.com/apache/spark/pull/2381
https://github.com/apache/spark/pull/2390

Author : ravipesala ravindra.pesala@huawei.com

It seems we cannot use the ```import org.apache.spark.sql.SQLContext._``` at the beginning of file to use implicit. Because there is no ```object``` defined for ```SQLContext``` and implicits are only part of ```class SQLContext```. We can only use the import on instance like ```import sqlContext._``` Please correct me if I am wrong.