Accessing hive tables in spark-shell


#1

hi,

can you provide a step by step guide to access hive tables in spark-shell (itversity lab).


#2

@Sfdc_Learning
Please try below example:

import org.apache.spark.sql.hive.HiveContext
val sqlContext = new HiveContext(sc)
val depts = sqlContext.sql("select * from orders")
depts.foreach(println)