Environment: Scala and spark 1.6
I am trying to -
1. getting json data through Rest API call
2. write in HDFS as json file
3. Convert json file into dataframe
val rawdata = "curl http://services.groupkt.com/state/get/USA/all"!!
println(rawdata) // can see json output, but can't save as file in HDFS
I can see output on screen, but how can I write contents of rawdata to hdfs url (hdfs://quickstart.cloudera:8020/user/hive/warehouse/test/)? Or is there any way to purse content of rawdata without saving as file? I also need to convert json to dataframe.
Thanks in advance
Hossain