<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Converting JSON to Rdd in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155859#M32876</link>
    <description>&lt;PRE&gt;val dataframe = sqlContext.read.json(&amp;lt;a RDD[String] where each line is JSON object&amp;gt;)&lt;/PRE&gt;&lt;P&gt;See &lt;A href="https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrameReader.html#json(org.apache.spark.rdd.RDD)" target="_blank"&gt;https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrameReader.html#json(org.apache.spark.rdd.RDD)&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jun 2016 06:32:18 GMT</pubDate>
    <dc:creator>clukasik</dc:creator>
    <dc:date>2016-06-24T06:32:18Z</dc:date>
    <item>
      <title>Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155854#M32871</link>
      <description>&lt;P&gt;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&amp;lt;ROW&amp;gt;. Is there any class to do that in spark?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 05:17:03 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155854#M32871</guid>
      <dc:creator>amehta7</dc:creator>
      <dc:date>2016-06-24T05:17:03Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155855#M32872</link>
      <description>&lt;P&gt;&lt;A href="http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets" target="_blank"&gt;http://spark.apache.org/docs/latest/sql-programming-guide.html#json-datasets&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 05:38:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155855#M32872</guid>
      <dc:creator>rgelhausen</dc:creator>
      <dc:date>2016-06-24T05:38:36Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155856#M32873</link>
      <description>&lt;P&gt;I dont want to read from files. I have json data in a variable coming from http response in my code.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 05:47:21 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155856#M32873</guid>
      <dc:creator>amehta7</dc:creator>
      <dc:date>2016-06-24T05:47:21Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155857#M32874</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11421/amehta7.html" nodeid="11421"&gt;@Akash Mehta&lt;/A&gt; Can you do something like this?&lt;/P&gt;&lt;DIV&gt;
					&lt;P&gt;dataframe = sqlContext.read.format(“json”).load(your json here) &lt;/P&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 24 Jun 2016 05:58:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155857#M32874</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-06-24T05:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155858#M32875</link>
      <description>&lt;P&gt;But "your json here" takes a path and i am having the json from an httpresponse (converted to string).&lt;/P&gt;&lt;P&gt;I need to read from that and infer the schema and convert to rdd&amp;lt;ROW&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 06:04:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155858#M32875</guid>
      <dc:creator>amehta7</dc:creator>
      <dc:date>2016-06-24T06:04:19Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155859#M32876</link>
      <description>&lt;PRE&gt;val dataframe = sqlContext.read.json(&amp;lt;a RDD[String] where each line is JSON object&amp;gt;)&lt;/PRE&gt;&lt;P&gt;See &lt;A href="https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrameReader.html#json(org.apache.spark.rdd.RDD)" target="_blank"&gt;https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrameReader.html#json(org.apache.spark.rdd.RDD)&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 06:32:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155859#M32876</guid>
      <dc:creator>clukasik</dc:creator>
      <dc:date>2016-06-24T06:32:18Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155860#M32877</link>
      <description>&lt;P&gt;load will infer schema and convert to a row. Question is whether it will take an http url. Can you try?&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 06:51:29 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155860#M32877</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-06-24T06:51:29Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155861#M32878</link>
      <description>&lt;P&gt;This will output a dataframe and i need RDD[Row]&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 08:14:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155861#M32878</guid>
      <dc:creator>amehta7</dc:creator>
      <dc:date>2016-06-24T08:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155862#M32879</link>
      <description>&lt;P&gt;Will this work?&lt;/P&gt;&lt;P&gt;&lt;A href="https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrame.html#rdd%28%29"&gt;https://spark.apache.org/docs/1.6.0/api/java/org/apache/spark/sql/DataFrame.html#rdd()&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 24 Jun 2016 19:16:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155862#M32879</guid>
      <dc:creator>clukasik</dc:creator>
      <dc:date>2016-06-24T19:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155863#M32880</link>
      <description>&lt;P&gt;Yes yes load will do that but load requires an input path and i have my json stored in a string variable.&lt;/P&gt;</description>
      <pubDate>Sat, 25 Jun 2016 02:00:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155863#M32880</guid>
      <dc:creator>amehta7</dc:creator>
      <dc:date>2016-06-25T02:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Converting JSON to Rdd</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155864#M32881</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/11421/amehta7.html" nodeid="11421"&gt;@Akash Mehta&lt;/A&gt; &lt;/P&gt;&lt;P&gt;So, even following wont work for you? If not, I think currently there is no other way given we have looked at all other possible options.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;//a DataFrame can be created for a JSON dataset represented by
// an RDD[String] storing one JSON object per string.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;val anotherPeopleRDD = sc.parallelize(
  """{"name":"Yin","address":{"city":"Columbus","state":"Ohio"}}""" :: Nil)
val anotherPeople = sqlContext.read.json(anotherPeopleRDD)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 26 Jun 2016 08:54:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Converting-JSON-to-Rdd/m-p/155864#M32881</guid>
      <dc:creator>mqureshi</dc:creator>
      <dc:date>2016-06-26T08:54:41Z</dc:date>
    </item>
  </channel>
</rss>

