You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@spark.apache.org by RP <ha...@outlook.com> on 2015/01/03 01:31:57 UTC
How to convert String data to RDD.
Hello Guys,
Spark noob here. I am trying to create RDD from JSON data fetched
from URL parsing.
My URL parsing function gives me JSON in string format.
How do I convert JSON string to JSONRDD so that I can use it in SparkSQL.
// get json data in string fromat
val jsonURLData = getUrlAsString("https://somehost.com/test.json")
val jsonDataRDD = ?
val json1 = sqlContext.jsonRDD(jsonDataRDD)
Thanks,
RP
Re: How to convert String data to RDD.
Posted by Ted Yu <yu...@gmail.com>.
Please see http://search-hadoop.com/m/JW1q53L9PJ
On Fri, Jan 2, 2015 at 4:31 PM, RP <ha...@outlook.com> wrote:
> Hello Guys,
> Spark noob here. I am trying to create RDD from JSON data fetched from
> URL parsing.
> My URL parsing function gives me JSON in string format.
> How do I convert JSON string to JSONRDD so that I can use it in SparkSQL.
>
>
>
> // get json data in string fromat
> val jsonURLData = getUrlAsString("https://somehost.com/test.json"
> <https://somehost.com/test.json>)
>
> val jsonDataRDD = ?
>
> val json1 = sqlContext.jsonRDD(jsonDataRDD)
>
> Thanks,
> RP
>
>
>
>
>