FAQ
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>()

I am using 0.21.0

Thanks for your help
Ranjan


--------------------------------------------------------------------------
Important Notice to Recipients:

The sender of this e-mail is an employee of Morgan Stanley Smith Barney LLC. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Erroneous transmission is not intended to waive confidentiality or privilege. Morgan Stanley Smith Barney reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers/mssbemail.html. If you cannot access this link, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley Smith Barney you consent to the foregoing.

Search Discussions

  • John Armstrong at Jul 28, 2011 at 2:48 pm

    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

Related Discussions

Discussion Navigation
viewthread | post
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 © 2023 Grokbase