Support Questions

Find answers, ask questions, and share your expertise

Converting JSON to Rdd

avatar
Explorer

I am getting a json response, and in my sparkSQL data source, i need to read the data and infer schema for the json and convert in to rdd<ROW>. Is there any class to do that in spark?

Thanks

1 ACCEPTED SOLUTION

avatar
Super Collaborator
val dataframe = sqlContext.read.json(<a RDD[String] where each line is JSON object>)

See https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrameReader.html#json(org.apac...

View solution in original post

10 REPLIES 10

avatar
Super Collaborator