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

Scalar fail if the scalar variable is generated by limit

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.8.0
    • 0.8.0
    • impl
    • None
    • Reviewed

    Description

      The following script fail:

      a = load 'studenttab10k' as (name: chararray, age: int, gpa: float);
      b = group a all;
      c = foreach b generate SUM(a.age) as total;
      c1= limit c 1;
      d = foreach a generate name, age/(double)c1.total as d_sum;
      store d into '111';
      

      The problem is we have a reference to c1 in d. In the optimizer, we push limit before foreach, d still reference to limit, and we get the wrong schema for the scalar.

      Attachments

        1. PIG-1636-1.patch
          3 kB
          Daniel Dai

        Activity

          People

            daijy Daniel Dai
            daijy Daniel Dai
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: