Note that there are some explanatory texts on larger screens.

plurals
  1. POhadoop MultipleInputs fails with ClassCastException
    text
    copied!<p>My hadoop version is 1.0.3,when I use multipleinputs, I got this error. </p> <pre><code>java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit cannot be cast to org.apache.hadoop.mapreduce.lib.input.FileSplit at org.myorg.textimage$ImageMapper.setup(textimage.java:80) at org.apache.hadoop.mapreduce.Mapper.run(Mapper.java:142) at org.apache.hadoop.mapreduce.lib.input.DelegatingMapper.run(DelegatingMapper.java:55) at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:764) at org.apache.hadoop.mapred.MapTask.run(MapTask.java:370) at org.apache.hadoop.mapred.Child$4.run(Child.java:255) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:416) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1121) at org.apache.hadoop.mapred.Child.main(Child.java:249) </code></pre> <p>I tested single input path, no problem. Only when I use</p> <pre><code>MultipleInputs.addInputPath(job, TextInputpath, TextInputFormat.class, TextMapper.class); MultipleInputs.addInputPath(job, ImageInputpath, WholeFileInputFormat.class, ImageMapper.class); </code></pre> <p>I googled and found this link <a href="https://issues.apache.org/jira/browse/MAPREDUCE-1178" rel="noreferrer">https://issues.apache.org/jira/browse/MAPREDUCE-1178</a> which said 0.21 had this bug. But I am using 1.0.3, does this bug come back again. Anyone has the same problem or anyone can tell me how to fix it? Thanks</p> <p>here is the setup code of image mapper,4th line is where the error occurs:</p> <pre><code>protected void setup(Context context) throws IOException, InterruptedException { InputSplit split = context.getInputSplit(); Path path = ((FileSplit) split).getPath(); try { pa = new Text(path.toString()); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload