
Introducing Spark andKafka | 137
valemp_country = hiveContext.sql(“select distinct(ctry) from
empSpark”).collect.foreach(println)
//to display five records from the table ‘author_hive’ from ‘sqoopdb’
valemp_country = hiveContext.sql(“select * from sqoopdb.author_hive
limit 5”).collect.foreach(println)
//to display the number of total records from the table ‘author_hive’
from ‘sqoopdb’
valemp_country = hiveContext.sql(“select count(*) from sqoopdb.author_
hive”).collect.foreach(println)
6.1.5 Spark Libraries: Streaming
The Spark Streaming library is for streaming data. It is a very popular library as it takes
Spark’s big data processing power and ...