FAQ

On Thu, 28 Jul 2011 10:05:57 -0400, "Kumar, Ranjan" 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

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupcommon-user @
categorieshadoop
postedJul 28, '11 at 2:42p
activeJul 28, '11 at 2:48p
posts2
users2
websitehadoop.apache.org...
irc#hadoop

2 users in discussion

John Armstrong: 1 post Kumar, Ranjan: 1 post

People

Translate

site design / logo © 2022 Grokbase