<?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 input path on sandbox for loading data into spark shell in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151048#M28555</link>
    <description>&lt;H1&gt;&lt;/H1&gt;&lt;P&gt;hi - i am trying to load my json file using spark and
 cannot seem to do it correctly. the path at the end of this bit of 
scala. the file is located on my sandbox in the tmp folder. i've tried:&lt;/P&gt;&lt;P&gt;val df2 = sqlContext.read.format("json").option("samplingRatio", "1.0").load("/tmp/rawpanda.json")&lt;/P&gt;&lt;P&gt;any help would be great thanks.&lt;/P&gt;&lt;P&gt;mark&lt;/P&gt;</description>
    <pubDate>Tue, 17 May 2016 07:54:18 GMT</pubDate>
    <dc:creator>mesteph6</dc:creator>
    <dc:date>2016-05-17T07:54:18Z</dc:date>
    <item>
      <title>input path on sandbox for loading data into spark shell</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151048#M28555</link>
      <description>&lt;H1&gt;&lt;/H1&gt;&lt;P&gt;hi - i am trying to load my json file using spark and
 cannot seem to do it correctly. the path at the end of this bit of 
scala. the file is located on my sandbox in the tmp folder. i've tried:&lt;/P&gt;&lt;P&gt;val df2 = sqlContext.read.format("json").option("samplingRatio", "1.0").load("/tmp/rawpanda.json")&lt;/P&gt;&lt;P&gt;any help would be great thanks.&lt;/P&gt;&lt;P&gt;mark&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2016 07:54:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151048#M28555</guid>
      <dc:creator>mesteph6</dc:creator>
      <dc:date>2016-05-17T07:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: input path on sandbox for loading data into spark shell</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151049#M28556</link>
      <description>&lt;P&gt;The input path you put corresponds to the location in the HDFS "/tmp/rawpanda.json".  If the file is actually sitting on your local filesystem, you should use the following instead "file:///tmp/rawpanda.json"&lt;/P&gt;&lt;P&gt;Also, one gotcha with reading JSON files using Spark is that the entire record needs to be on a single line (instead of the pretty exploded view) for the JSONreader to successfully parse the JSON record.  You can test if the JSON record is being read correctly by running the following bit of code:&lt;/P&gt;&lt;PRE&gt;df2.show(1)&lt;/PRE&gt;&lt;P&gt;If there is something like _corrupt in the first column, then the records are most likely not formed correctly.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 01:36:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151049#M28556</guid>
      <dc:creator>jwiden</dc:creator>
      <dc:date>2016-05-18T01:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: input path on sandbox for loading data into spark shell</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151050#M28557</link>
      <description>&lt;P&gt;Ahhh. Originally I loaded on windows machine and was getting the "incorrect/corrupt format" error so i thought switching over to the sandbox would help. i didn't realize by default that it loads from hdfs! so now, i have edited the JSON document and re-tried loading it in the spark-shell in windows, it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;so u answered both questions i had! thank u sir.&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 04:14:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/input-path-on-sandbox-for-loading-data-into-spark-shell/m-p/151050#M28557</guid>
      <dc:creator>mesteph6</dc:creator>
      <dc:date>2016-05-18T04:14:54Z</dc:date>
    </item>
  </channel>
</rss>

