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

WritableComparator newKey() fails for NullWritable

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.16.0
    • Fix Version/s: 0.18.0
    • Component/s: io
    • Labels:
      None
    • Environment:

      n/a

    • Hadoop Flags:
      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. 3665-0.patch
          10 kB
          Christopher Douglas
        2. 3665-1.patch
          10 kB
          Christopher Douglas
        3. 3665-2.patch
          9 kB
          Christopher Douglas
        4. HADOOP-3665.path
          7 kB
          Lukas Vlcek

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: