<?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: Saving a list in HDFS with headers using R in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120663#M30752</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10486/simrank.html" nodeid="10486"&gt;@Simran Kaur&lt;/A&gt; &lt;/P&gt;&lt;P&gt;When you convert using as.list then your data will look like the above. Whats your problem here? how do you want the data to look like? What are you trying to do here?&lt;/P&gt;</description>
    <pubDate>Tue, 07 Jun 2016 00:16:38 GMT</pubDate>
    <dc:creator>yjagadeesan</dc:creator>
    <dc:date>2016-06-07T00:16:38Z</dc:date>
    <item>
      <title>Saving a list in HDFS with headers using R</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120661#M30750</link>
      <description>&lt;P&gt;
	I have this data I fetched from an API using R in a list and it looks like this:&lt;/P&gt;
&lt;PRE&gt;                 productSku               productName productCategory       date
1                 (not set)                 (not set)       (not set) 2015-12-28
2                         1                         1               1 2015-12-28
3                         F                         F               F 2015-12-28
4                         I                         I               I 2015-12-28
5     IN1309MTODREBLA-112-M      Fantasy Garden Dress          sample 2016-02-09
&lt;/PRE&gt;&lt;P&gt;I am using the package rhdfs and Now, I am storing it in HDFS as:&lt;/P&gt;
&lt;PRE&gt;hdfs.write(get(fileName), modelfile)
&lt;/PRE&gt;&lt;P&gt;
	But when I try to read it back &lt;/P&gt;
&lt;PRE&gt;getLastDataImportDate = function(){
    hdfs.init()
    f = hdfs.file("/user/rstudio/gaDataEcommerce4","r")
    m = hdfs.read(f)
    m1 &amp;lt;- m
    mnull &amp;lt;- m == as.raw(0)
    m1[mnull] &amp;lt;- as.raw(20)
    c &amp;lt;- rawToChar(m1)
    li &amp;lt;- as.list(c)
    print(li)
&lt;/PRE&gt;&lt;P&gt;
	What I get back on reading data looks like this:&lt;/P&gt;
&lt;PRE&gt;[1] "X\n\024\024\024\002\024\003\002\003\024\002\003\024\024\024\003\023\024\024\024\t\024\024\024\020\024\024\002\xd9\024\004\024\t\024\024\024\t(not set)\024\004\024\t\024\024\024\0011\024\004\024\t\024\024\024\001F\024\004\024\t\024\024\024\001I\024\004\024\t\024\024\024\025IN1309MTODREBLA-112-M\024\004\024\t\024\024\024\025IN1309MTODREBLA-112-S\024\004\024\t\024\024\024\025IN1309MTODREBLA-112-S\024\004\024\t\024\024\024\025IN1309MTODREBLA-112-S\024\004\024\t\024\024\024\025IN1309MTODREBLA-112-S\024\004\024\t\024\024\024\025IN1309MTODREBLA-112-S\024\004\024\t\024\024\024\025IN1315MTODREPNK-114-S\024\004\024\t\024\024\024\025IN1317MTOJKTBLA-104-L\024\004\024\t\024\024\024\026IN1319MTODREGRN-110-XL\024\004\024\t\024\024\024\026IN1322MTPJKTRED-143-20\024\004\024\t\024\024\024\026IN1326MTODREPNK-117-XS\024\004\024\t\024\024\024\027IN1326MTODREPNK-117-XXL\024\004\024\t\024\024\024\023IN1329AVVBAGBLA-135\024\004\024\t\024\024\024\023IN1329AVVBAGBLA-135\024\004\024\t\024\024\024\023IN1329AVVBAGRED-138\024\004\024\t\024\024\024\023IN1329AVVBAGRED-138\024\004\024\t\024\024\024\023IN1329AVVBAGRED-138\024\004\024\t\024\024\024\025IN1329MTOTOPWHT-108-M\024\004\024\t\024\024\024\023IN1331AVVBAGRED-105\024\004\024\t\024\024\024\023IN1331AVVBAGRED-105\024\004\024\t\024\024\024\023IN1332AVVBAGBLU-118\024\004\024\t\024\024\024\023IN1332AVVBAGBLU-118\024\004\024\t\024\024\024\023IN1332AVVBAGPRL-168\024\004\024\t\024\024\024\023IN1332AVVBAGPRL-168\024\004\024\t\024\024\024\023IN1332AVVBAGRED-152\024\004\024\t\024\024\024\023IN1332AVVBAGSLR-130\024\004\024\t\024\024\024\023IN1332AVVBAGSLR-130\024\004\024\t\024\024\024\026IN1332MTPTOPBLA-137-20\024\004\024\t\024\024\024\023IN1335AVVBAGBLA-112\024\004\024\t\024\024\024\023IN1335AVVBAGBLA-137\024\004\024\t\024\024\024\023IN1336AVVBAGBLA-146\024\004\024\t\024\024\024\023IN1336AVVBAGBLA-146\024\004\024\t\024\024\024\023IN1336AVVBAGBLA-146\024\004\024\t\024\024\024\023IN1336AVVBAGBLA-146\024\004\024\t\024\024\024\023IN1336AVVBAGBLA-146\024\004\024\t\024\024\024\023IN1336AVVBAGSLR-143\024\004\024\t\024\024\024\023IN1336AVVBAGSLR-143\024\004\024\t\024\024\024\025IN1336MTODREBLA-179-S\024\004\024\t\024\024\024\025IN1336MTODREBLA-179-S\024\004\024\t\024\024\024\025IN1336MTODREBLA-179-S\024\004\024\t\024\024\024\025IN1336MTOTOPPNK-187-S\024\004\024\t\024\024\024\025IN1337MTODREBLA-101-S\024\004\024\t\024\024\024\025IN1337MTODREMLT-117-M\024\004\024\t\024\024\024\025IN1337MTODREMLT-117-M\024\004\024\t\024\024\024\026IN1337MTODREMLT-117-XS\024\004\024\t\024\024\024\027IN1337MTODREMLT-117-XXL\024\004\024\t\024\024\024\027IN1337MTODREMLT-117-XXL\024\004\024\t\024\024\024\027IN1337MTODREMLT-117-XXL\024\0
&lt;/PRE&gt;&lt;P&gt;It does not really look like a list to me? &lt;/P&gt;&lt;P&gt;Where are the column names here in this data? I believe it is only the data without header info.&lt;/P&gt;&lt;P&gt;Also, I need to get maximum date from date column that I had when I was writing data, how do I access it?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 10:23:24 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120661#M30750</guid>
      <dc:creator>simran_k</dc:creator>
      <dc:date>2022-09-16T10:23:24Z</dc:date>
    </item>
    <item>
      <title>Re: Saving a list in HDFS with headers using R</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120662#M30751</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;Do you have some sample dataset that I can use to reproduce this?&lt;/P&gt;</description>
      <pubDate>Sat, 04 Jun 2016 19:16:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120662#M30751</guid>
      <dc:creator>jyadav</dc:creator>
      <dc:date>2016-06-04T19:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Saving a list in HDFS with headers using R</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120663#M30752</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/10486/simrank.html" nodeid="10486"&gt;@Simran Kaur&lt;/A&gt; &lt;/P&gt;&lt;P&gt;When you convert using as.list then your data will look like the above. Whats your problem here? how do you want the data to look like? What are you trying to do here?&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2016 00:16:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120663#M30752</guid>
      <dc:creator>yjagadeesan</dc:creator>
      <dc:date>2016-06-07T00:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Saving a list in HDFS with headers using R</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120664#M30753</link>
      <description>&lt;P&gt;You can try as below &lt;/P&gt;&lt;PRE&gt;li &amp;lt;- read.table(textConnection(c), sep = ",");&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Jun 2016 02:25:46 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Saving-a-list-in-HDFS-with-headers-using-R/m-p/120664#M30753</guid>
      <dc:creator>yjagadeesan</dc:creator>
      <dc:date>2016-06-07T02:25:46Z</dc:date>
    </item>
  </channel>
</rss>

