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

Strings (or other typed data) stored in maps cause problems with implicit casts in operations

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.2.0
    • 0.2.0
    • None
    • None

    Description

      If a map in pig (say returned from a UDF) has a key with the value being a string, then a lookup of that key being used in a context which expects a string will cause an implicit cast to a string. This is because the Pig frontented (logical layer) thinks of all map "values" as bytearrays and hence introduces a Cast to convert the bytearray to string. The POCast class then assumes its input is a DataByteArray and first tries to cast its input to DataByteArray. This fails because the object in the input to the case which is the value in the map is in fact already a string. So in these cases, we should not try to cast but just return the input object in the POCast.

      Attachments

        1. PIG-463.patch
          22 kB
          Pradeep Kamath

        Activity

          People

            pkamath Pradeep Kamath
            pkamath Pradeep Kamath
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: