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

Uids not set in inner schemas after UNION ONSCHEMA

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.16.0, 0.17.0
    • Fix Version/s: 0.18.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Ran into a failure with a script of the form:

      u = union onschema x, y;  -- schema: (a, b: {(m:int, n: chararray)})
      z = foreach u {
          i = foreach b generate m + 5;
          generate a, i;
      }
      

      The issue ended up being that LOUnion is not setting uids on inner schemas. This means that uids on inner schema fields are all -1, so when ProjectExpression.getFieldSchema() tries to look up the fields in the inner select from the inner schema, all the fields match, and the last field's schema ends up being returned. In the example above this causes TypeCheckingExpVisitor.addCastsToNumericBinExpression() to fail for the addition operator (since the returned field schema is a chararray).

      This only seems to affect the schema, so I don't think this should cause bad data to be produced.

        Attachments

        1. PIG-5312_fixedspace.patch
          8 kB
          Koji Noguchi
        2. PIG-5312.patch
          9 kB
          Travis Woodruff

          Issue Links

            Activity

              People

              • Assignee:
                tmwoodruff Travis Woodruff
                Reporter:
                tmwoodruff Travis Woodruff
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: