[SPARK-SQL] HiveTableScan operator Performance Improvement 

The goal is to improve the performance of the HiveTableScan Operator:

As a quick benchmark run the following code in the scala interpreter:

scala> :paste

hql("CREATE TABLE IF NOT EXISTS sample (key1 INT, key2 INT,value STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY ','")
hql("LOAD DATA LOCAL INPATH 'examples/src/main/resources/sample2.txt' INTO TABLE sample")
println("Result of SELECT * FROM sample:")
val start = System.nanoTime
val recs = hql("FROM sample SELECT key1,key2,value").collect()
val micros = (System.nanoTime - start) / 1000
println("%d microsecondss".format(micros))

scala> CTRL-D

you can download the test file from here: 
http://homes.cs.washington.edu/~soroush/sample2.txt

"sample2.txt contains about 3.6 million rows. The improved code scans the entire table in about 9 seconds while the original code scans the entire table in about 22 seconds.


Regarding the last item in the task: 
"Avoid Reading Unneeded Data - Some Hive Serializer/Deserializer (SerDe) interfaces support reading only the required columns from the underlying HDFS files.  We should use ColumnProjectionUtils to configure these correctly." 
The way to do it, should be similar to the following code: 

https://github.com/amplab/shark/blob/master/src/main/scala/shark/execution/TableScanOperator.scala

I tried to take a similar approach, but I am not sure columnar reading is working at hiveOperators.scala right now. Anyway, it requires more time for me to make sure that last feature is working. Please notice that it was the first time that I wrote code in scala and it took me some time to get comfortable with the language.