On Thu, 28 Jul 2011 10:05:57 -0400, "Kumar, Ranjan"
<ranjan.kum...@morganstanleysmithbarney.com> wrote:
> I have a class to define data I am reading from a MySQL database.
> According to online tutorials I created a class called MyRecord and
> extended it from Writable, DBWritable. While running it with hadoop I
get a
> NoSuchMethodException: dataTest$MyRecord.<init>()

Hadoop needs a noargs constructor to build the object, which it then fills
in by using readFields().  Many classes come with a default noargs
constructor, which basically defers to the noargs contructor from Object,
or another ancestor class.

HOWEVER

If you defined another constructor that takes arguments, you've implicitly
removed the default noargs constructor on your class.  You need to define
one explicitly, which Hadoop can use to build your objects.

hth

Reply via email to