<?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: Write CSV in HDFS in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121477#M30805</link>
    <description>&lt;P&gt;What I ended up doing is pretty stupid. I used write.csv and wrote it locally and then usd hdfs.put to move it to hdfs. Data type of data is list. How do I convert it to csv before writing it in hdfs using hdfs.write ? &lt;A rel="user" href="https://community.cloudera.com/users/3486/cstanca.html" nodeid="3486"&gt;@Constantin Stanca&lt;/A&gt; . Thank you so much for your response though. I hope to hear back on this.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2016 11:49:39 GMT</pubDate>
    <dc:creator>simran_k</dc:creator>
    <dc:date>2016-06-07T11:49:39Z</dc:date>
    <item>
      <title>Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121475#M30803</link>
      <description>&lt;P&gt;I wrote the following function to write data in HDFS using R and am using rhdfs.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;writeToHDFS &amp;lt;-function(fileName){
   hdfs.init()
   modelfile &amp;lt;- hdfs.file(fileName,"w")
   hdfs.write(get(fileName), modelfile)
   hdfs.close(modelfile)}&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;How do I modify it store this data in CSV format instead?I have tried using &lt;CODE&gt;pipe&lt;/CODE&gt; but since it is deprecated, I would like a way to write CSV files through hdfs.write functions.&lt;/P&gt;&lt;P&gt;I tried this:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;   modelfile &amp;lt;- hdfs.file(paste(fileName,"csv", sep="."),"w")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;but I do not think it creates a valid CSV but only appends the extension for it.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2016 13:07:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121475#M30803</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-06T13:07:57Z</dc:date>
    </item>
    <item>
      <title>Re: Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121476#M30804</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10486/simrank.html" nodeid="10486"&gt;@sameer lail&lt;/A&gt;&lt;/P&gt;&lt;P&gt;What data format is the file that you assign to modelfile dataframe? If it is not csv then you would need to convert it to csv before writing it to HDFS. If it is csv then check this Q/A: &lt;A href="https://community.hortonworks.com/questions/36583/how-to-save-data-in-hdfs-using-r.html" target="_blank"&gt;https://community.hortonworks.com/questions/36583/how-to-save-data-in-hdfs-using-r.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 04:21:57 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121476#M30804</guid>
      <dc:creator>cstanca</dc:creator>
      <dc:date>2016-06-07T04:21:57Z</dc:date>
    </item>
    <item>
      <title>Re: Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121477#M30805</link>
      <description>&lt;P&gt;What I ended up doing is pretty stupid. I used write.csv and wrote it locally and then usd hdfs.put to move it to hdfs. Data type of data is list. How do I convert it to csv before writing it in hdfs using hdfs.write ? &lt;A rel="user" href="https://community.cloudera.com/users/3486/cstanca.html" nodeid="3486"&gt;@Constantin Stanca&lt;/A&gt; . Thank you so much for your response though. I hope to hear back on this.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 11:49:39 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121477#M30805</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-07T11:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121478#M30806</link>
      <description>&lt;P&gt;The file that gets written in hdfs with hdfs.write without specifying the file type has no extension at all. So, I actually needed to know what is the default format the hdfs.write would write in ?How do I specify the file type I would like to store the data in? &lt;A rel="user" href="https://community.cloudera.com/users/3486/cstanca.html" nodeid="3486"&gt;@Constantin Stanca&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 11:51:40 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121478#M30806</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-07T11:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121479#M30807</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10486/simrank.html" nodeid="10486"&gt;@sameer lail&lt;/A&gt; &lt;/P&gt;&lt;P&gt;We are using rhive for moving files to HDFS in R . Do we have any additional advantages with rhdfs? &lt;/P&gt;&lt;P&gt;just I'm asking to check and to implement in my project as well.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 11:58:06 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121479#M30807</guid>
      <dc:creator>divakarreddy_a</dc:creator>
      <dc:date>2016-06-07T11:58:06Z</dc:date>
    </item>
    <item>
      <title>Re: Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121480#M30808</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2348/divakarreddya.html" nodeid="2348"&gt;@Divakar Annapureddy&lt;/A&gt;: I am using rhdfs but no major added advantages of using rhive. It looks like rhdfs only with all its functions. It is a little more polished though and offers a bit more functionality than rhdfs.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 12:07:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121480#M30808</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2016-06-07T12:07:05Z</dc:date>
    </item>
    <item>
      <title>Re: Write CSV in HDFS</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121481#M30809</link>
      <description>&lt;P&gt;@&lt;A href="https://community.hortonworks.com/users/10486/simrank.html"&gt;sameer lail&lt;/A&gt; &lt;/P&gt;&lt;P&gt;It is not stupid what you did. CSV is a file format, not a data structure in R. What you could is to create a dataframe with a single column with all values separated by comma then use hdfs write to output that as a file with extension csv. Another option is to write map-reduce with R and streaming API and set the output to be csv. &lt;/P&gt;&lt;P&gt;If any of my responses were helpful, please don't forget to vote them.&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jun 2016 10:02:05 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Write-CSV-in-HDFS/m-p/121481#M30809</guid>
      <dc:creator>cstanca</dc:creator>
      <dc:date>2016-06-09T10:02:05Z</dc:date>
    </item>
  </channel>
</rss>

