Uploaded image for project: 'Pig'
  1. Pig
  2. PIG-4506

binstorage fails to write biginteger

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.15.0
    • Component/s: data, impl
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      When trying to store a biginteger using binstorage the following error is issued (The error might manifest elsewhere too):
      java.lang.RuntimeException: Unexpected data type -1 found in stream

      This is caused by a bug in the writeDatum method of the DataReaderWriter.java class. When writeDatum is called with a BigInteger as a argument, the BigInteger is converted to a byte[] and the writeDatum method is recursively called on the byte[]. writeDatum cannon handle byte[] objects but instead expects DataByteArray objects.

      Suggested fix - wrap byte[] to DataByteArray:
      change this line:
      writeDatum(out, ((BigInteger)val).toByteArray());
      to this:
      writeDatum(out, new DataByteArray(((BigInteger)val).toByteArray()));

        Attachments

        1. PIG-4506-2.patch
          5 kB
          Jianyong Dai
        2. PIG-4506-1.patch
          2 kB
          Jianyong Dai

          Activity

            People

            • Assignee:
              ssavvides Savvas Savvides
              Reporter:
              ssavvides Savvas Savvides
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified