<?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: Error when using MapReduce Streaming in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103288#M21425</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2686/zahermahdhi.html" nodeid="2686"&gt;@Zaher Mahdhi&lt;/A&gt;&lt;/P&gt;&lt;P&gt; I was able to reproduce this and now job is running after fixing R script.&lt;/P&gt;&lt;P&gt;R script needs to look like this....Notice the next line between env and Rscript&lt;/P&gt;&lt;PRE&gt;#!/usr/bin/env
Rscript
f &amp;lt;- file("stdin")
open(f)
state_data = read.table(f)
summary(state_data)&lt;/PRE&gt;&lt;PRE&gt;hadoop jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming-2.7.1.2.3.4.0-3485.jar  -input cities.txt -output streamout11_r -mapper /bin/cat -reducer script.r -numReduceTasks 2 -file script.r&lt;/PRE&gt;</description>
    <pubDate>Tue, 01 Mar 2016 19:08:43 GMT</pubDate>
    <dc:creator>nsabharwal</dc:creator>
    <dc:date>2016-03-01T19:08:43Z</dc:date>
    <item>
      <title>Error when using MapReduce Streaming</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103287#M21424</link>
      <description>&lt;P&gt;I'm following this tutorial: &lt;/P&gt;&lt;P&gt;&lt;A href="http://hortonworks.com/blog/using-r-and-other-non-java-languages-in-mapreduce-and-hive/" target="_blank"&gt;http://hortonworks.com/blog/using-r-and-other-non-java-languages-in-mapreduce-and-hive/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I put cities.txt in /user/root/ and the R script as following :&lt;/P&gt;&lt;PRE&gt;#!/usr/bin/env Rscript
f &amp;lt;- file("stdin")
open(f)
state_data = read.table(f)
summary(state_data)&lt;/PRE&gt;&lt;P&gt;and then run the command:&lt;/P&gt;&lt;PRE&gt; hadoop jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming-2.7.1.2.3.4.0-3485.jar -input /user/root/cities.txt -output /user/root/streamer -mapper /bin/cat -reducer script.R -numReduceTasks 2 -file script.R 
&lt;/PRE&gt;&lt;P&gt;Map works till 100% and reduce shows this error:&lt;/P&gt;&lt;PRE&gt;16/03/01 11:06:30 INFO mapreduce.Job:  map 100% reduce 50%
16/03/01 11:06:34 INFO mapreduce.Job: Task Id : attempt_1456773989186_0009_r_000001_0, Status : FAILED
Error: java.lang.RuntimeException: PipeMapRed.waitOutputThreads(): subprocess failed with code 1
    at org.apache.hadoop.streaming.PipeMapRed.waitOutputThreads(PipeMapRed.java:322)
    at org.apache.hadoop.streaming.PipeMapRed.mapRedFinished(PipeMapRed.java:535)
    at org.apache.hadoop.streaming.PipeReducer.close(PipeReducer.java:134)
    at org.apache.hadoop.io.IOUtils.cleanup(IOUtils.java:244)
    at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:459)
    at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:392)
    at org.apache.hadoop.mapred.YarnChild$2.run(YarnChild.java:168)
    at java.security.AccessController.doPrivileged(Native Method)
    at javax.security.auth.Subject.doAs(Subject.java:422)
    at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
    at org.apache.hadoop.mapred.YarnChild.main(YarnChild.java:162)

&lt;/PRE&gt;&lt;P&gt;Does any one have any idea or encountered this before ?&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2016 18:10:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103287#M21424</guid>
      <dc:creator>zaher_mahdhi</dc:creator>
      <dc:date>2016-03-01T18:10:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using MapReduce Streaming</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103288#M21425</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/2686/zahermahdhi.html" nodeid="2686"&gt;@Zaher Mahdhi&lt;/A&gt;&lt;/P&gt;&lt;P&gt; I was able to reproduce this and now job is running after fixing R script.&lt;/P&gt;&lt;P&gt;R script needs to look like this....Notice the next line between env and Rscript&lt;/P&gt;&lt;PRE&gt;#!/usr/bin/env
Rscript
f &amp;lt;- file("stdin")
open(f)
state_data = read.table(f)
summary(state_data)&lt;/PRE&gt;&lt;PRE&gt;hadoop jar /usr/hdp/current/hadoop-mapreduce-client/hadoop-streaming-2.7.1.2.3.4.0-3485.jar  -input cities.txt -output streamout11_r -mapper /bin/cat -reducer script.r -numReduceTasks 2 -file script.r&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 Mar 2016 19:08:43 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103288#M21425</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2016-03-01T19:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error when using MapReduce Streaming</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103289#M21426</link>
      <description>&lt;P&gt;That solved the problem but the Map job stacked, and even after killing it the Yarn container still exists I had to kill it manually. i'll be back to this shortly.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 18:42:35 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-when-using-MapReduce-Streaming/m-p/103289#M21426</guid>
      <dc:creator>zaher_mahdhi</dc:creator>
      <dc:date>2016-03-04T18:42:35Z</dc:date>
    </item>
  </channel>
</rss>

