I have "iplRDD", which is json, and I do the below steps and request through hivecontext. I get results, but without column headers. Is there a way to get column names along with values?
val teamRDD = hiveContext.jsonRDD(iplRDD)
teamRDD.registerTempTable("teams")
hiveContext.cacheTable("teams")
val result = hiveContext.sql("select * from teams where team_name = "KKR" )
result.collect.foreach(println)
Any thoughts please?
source
share