Hadoop Map/Reduce
  1. Hadoop Map/Reduce
  2. MAPREDUCE-1178

MultipleInputs fails with ClassCastException

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 0.21.0
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When running MultipleInputs against the new API, we get failures with this ClassCastException:

      java.lang.ClassCastException: org.apache.hadoop.mapreduce.lib.input.TaggedInputSplit cannot be cast to org.apache.hadoop.mapreduce.lib.input.FileSplit
      at org.apache.hadoop.mapreduce.lib.input.LineRecordReader.initialize(LineRecordReader.java:70)
      at org.apache.hadoop.mapreduce.lib.input.KeyValueLineRecordReader.initialize(KeyValueLineRecordReader.java:59)
      at org.apache.hadoop.mapred.MapTask$NewTrackingRecordReader.initialize(MapTask.java:439)
      at org.apache.hadoop.mapred.MapTask.runNewMapper(MapTask.java:599)
      at org.apache.hadoop.mapred.MapTask.run(MapTask.java:323)
      at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:257)

      The unit test for MultipleInputs doesn't actually run a job so this snuck through while still passing the unit test. Attached patch fixes the unit test to expose the failure and does a little casting kung-fu in LineRecordReader to avoid the error.

      1. patch-1178-1.txt
        11 kB
        Amareshwari Sriramadasu
      2. patch-1178.txt
        11 kB
        Amareshwari Sriramadasu
      3. MAPREDUCE-1178.patch
        8 kB
        Jay Booth

        Activity

        Jay Booth created issue -
        Hide
        Jay Booth added a comment -

        attached patch fixes ClassCastException and expands unit test to catch a wider variety of problems

        Show
        Jay Booth added a comment - attached patch fixes ClassCastException and expands unit test to catch a wider variety of problems
        Jay Booth made changes -
        Field Original Value New Value
        Attachment MAPREDUCE-1178.patch [ 12423859 ]
        Jay Booth made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12423859/MAPREDUCE-1178.patch
        against trunk revision 831816.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        -1 contrib tests. The patch failed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12423859/MAPREDUCE-1178.patch against trunk revision 831816. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/220/console This message is automatically generated.
        Hide
        Amareshwari Sriramadasu added a comment -

        Cancelling patch, since it introduces a hack in LineRecordReader

        Show
        Amareshwari Sriramadasu added a comment - Cancelling patch, since it introduces a hack in LineRecordReader
        Amareshwari Sriramadasu made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Amareshwari Sriramadasu added a comment -

        patch adds a DelegatingRecordReader which calls underlying record-reader methods for a split.
        Thanks Jay for the testcase. Testcase passes with the patch.

        Show
        Amareshwari Sriramadasu added a comment - patch adds a DelegatingRecordReader which calls underlying record-reader methods for a split. Thanks Jay for the testcase. Testcase passes with the patch.
        Amareshwari Sriramadasu made changes -
        Attachment patch-1178.txt [ 12423895 ]
        Amareshwari Sriramadasu made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12423895/patch-1178.txt
        against trunk revision 831816.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        -1 contrib tests. The patch failed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12423895/patch-1178.txt against trunk revision 831816. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/221/console This message is automatically generated.
        Hide
        Amareshwari Sriramadasu added a comment -

        -1 contrib tests. Test failure is due to MAPREDUCE-1124

        Show
        Amareshwari Sriramadasu added a comment - -1 contrib tests. Test failure is due to MAPREDUCE-1124
        Hide
        Jay Booth added a comment -

        Thanks Amareshwari, your patch is definitely much better.

        Show
        Jay Booth added a comment - Thanks Amareshwari, your patch is definitely much better.
        Hide
        Sharad Agarwal added a comment -

        Patch looks great. Minor nit: Add javadoc to the public constructor of DelegatingRecordReader.

        Show
        Sharad Agarwal added a comment - Patch looks great. Minor nit: Add javadoc to the public constructor of DelegatingRecordReader.
        Amareshwari Sriramadasu made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Hide
        Amareshwari Sriramadasu added a comment -

        Added the java doc

        Show
        Amareshwari Sriramadasu added a comment - Added the java doc
        Amareshwari Sriramadasu made changes -
        Attachment patch-1178-1.txt [ 12424114 ]
        Hide
        Amareshwari Sriramadasu added a comment -

        Ran ant javadoc, it passed successfully.

        Show
        Amareshwari Sriramadasu added a comment - Ran ant javadoc, it passed successfully.
        Amareshwari Sriramadasu made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Amareshwari Sriramadasu added a comment -

        resubmitting for hudson

        Show
        Amareshwari Sriramadasu added a comment - resubmitting for hudson
        Amareshwari Sriramadasu made changes -
        Status Patch Available [ 10002 ] Open [ 1 ]
        Amareshwari Sriramadasu made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Hide
        Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12424114/patch-1178-1.txt
        against trunk revision 833275.

        +1 @author. The patch does not contain any @author tags.

        +1 tests included. The patch appears to include 3 new or modified tests.

        +1 javadoc. The javadoc tool did not generate any warning messages.

        +1 javac. The applied patch does not increase the total number of javac compiler warnings.

        +1 findbugs. The patch does not introduce any new Findbugs warnings.

        +1 release audit. The applied patch does not increase the total number of release audit warnings.

        +1 core tests. The patch passed core unit tests.

        +1 contrib tests. The patch passed contrib unit tests.

        Test results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/testReport/
        Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
        Checkstyle results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/artifact/trunk/build/test/checkstyle-errors.html
        Console output: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/console

        This message is automatically generated.

        Show
        Hadoop QA added a comment - +1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12424114/patch-1178-1.txt against trunk revision 833275. +1 @author. The patch does not contain any @author tags. +1 tests included. The patch appears to include 3 new or modified tests. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Mapreduce-Patch-h6.grid.sp2.yahoo.net/228/console This message is automatically generated.
        Hide
        Sharad Agarwal added a comment -

        I just committed this. Thanks Amareshwari and Jay.

        Show
        Sharad Agarwal added a comment - I just committed this. Thanks Amareshwari and Jay.
        Sharad Agarwal made changes -
        Hadoop Flags [Reviewed]
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Assignee Amareshwari Sriramadasu [ amareshwari ]
        Resolution Fixed [ 1 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #114 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Mapreduce-trunk-Commit/114/)
        . Fix ClassCastException in MultipleInputs by adding a DelegatingRecordReader. Contributed by Amareshwari Sriramadasu and Jay Booth.

        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #114 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Mapreduce-trunk-Commit/114/ ) . Fix ClassCastException in MultipleInputs by adding a DelegatingRecordReader. Contributed by Amareshwari Sriramadasu and Jay Booth.
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #139 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Mapreduce-trunk/139/)

        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #139 (See http://hudson.zones.apache.org/hudson/job/Hadoop-Mapreduce-trunk/139/ )
        Tom White made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Amareshwari Sriramadasu
            Reporter:
            Jay Booth
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development