How to query Hive tables from Spark Shell

How to query Hive tables from Spark Shell.

scala> import org.apache.spark.sql.hive.HiveContext scala> val hiveContext = new HiveContext(sc) scala> val results = hiveContext.sql(“select * from employees”) scala> results.show(false)

Remember to use show with the false flag to avoid the output columns from being truncated.