Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-3665

WritableComparator newKey() fails for NullWritable

VotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 0.16.0
    • 0.18.0
    • io
    • None
    • n/a

    • Incompatible change, Reviewed

    Description

      It is not possible to use NullWritable as a key in order to suppress key value in output.

      Syndrome exception:
      Caused by: java.lang.IllegalAccessException: Class org.apache.hadoop.io.WritableComparator can not access a member of class org.apache.hadoop.io.NullWritable with modifiers "private"

      The problem is that NullWritable is a singleton and does not provide public non-parametric constructor. The following code in WritableComparator causes the exception: return (WritableComparable)keyClass.newInstance();

      Proposed simple solution is to use ReflectionUtils instead (it requires modification as well).

      This issue is probably related to HADOOP-2922

      Attachments

        1. HADOOP-3665.path
          7 kB
          Lukas Vlcek
        2. 3665-2.patch
          9 kB
          Christopher Douglas
        3. 3665-1.patch
          10 kB
          Christopher Douglas
        4. 3665-0.patch
          10 kB
          Christopher Douglas

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            cdouglas Christopher Douglas
            lukas.vlcek Lukas Vlcek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Issue deployment