You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-user@hadoop.apache.org by Simon Klausner <he...@gmx.at> on 2011/10/21 09:28:41 UTC

InputFormat Problem

Hi,

 

i'm trying to define my own InputFormat and RecordReader, however I'm
getting a type mismatch error in the createRecordReader method of the
InputFormat class.

 

Here is the inputformat:

http://codepad.org/wdr2NqBe

 

here is the recordreader:

 <http://codepad.org/9cmY6BjS> http://codepad.org/9cmY6BjS

 

i get the error at the inputformat class line 20: return new
PDFLinkRecordReader();

 

error: type mismatch: cannot convert PDFLinkRecordReader to
RecordReader<DBObject,String>.

How can I fix this problem? I checked the following tutorial:
<http://developer.yahoo.com/hadoop/tutorial/module5.html>
http://developer.yahoo.com/hadoop/tutorial/module5.html

I don't see my mistake.

 

Best regards


Re: InputFormat Problem

Posted by Harsh J <ha...@cloudera.com>.
Hey Simon,

You're mixing the new mapreduce.* API with the stable mapred.* API in
your implementation. I believe this could be due to a silly mistake
surrounding importing classes in an IDE.

i.e. You've implemented a org.apache.hadoop.mapred.RecordReader and
are trying to use that in a org.apache.hadoop.mapreduce.InputFormat
derivative, which will not work.

Try changing your InputFormat to import
org.apache.hadoop.mapred.InputFormat or vice versa (for your
RecordReader).

On Fri, Oct 21, 2011 at 12:58 PM, Simon Klausner <he...@gmx.at> wrote:
> Hi,
>
>
>
> i'm trying to define my own InputFormat and RecordReader, however I'm
> getting a type mismatch error in the createRecordReader method of the
> InputFormat class.
>
>
>
> Here is the inputformat:
>
> http://codepad.org/wdr2NqBe
>
>
>
> here is the recordreader:
>
>  <http://codepad.org/9cmY6BjS> http://codepad.org/9cmY6BjS
>
>
>
> i get the error at the inputformat class line 20: return new
> PDFLinkRecordReader();
>
>
>
> error: type mismatch: cannot convert PDFLinkRecordReader to
> RecordReader<DBObject,String>.
>
> How can I fix this problem? I checked the following tutorial:
> <http://developer.yahoo.com/hadoop/tutorial/module5.html>
> http://developer.yahoo.com/hadoop/tutorial/module5.html
>
> I don't see my mistake.
>
>
>
> Best regards
>
>



-- 
Harsh J