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

Optimize nested foreach

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: impl
    • Labels:
      None

      Description

      In this Pig script:

      A = load 'data' as (a:chararray);
      B = foreach A { c = UPPER(a); generate ((c eq 'TEST') ? 1 : 0), ((c eq 'DEV') ? 1 : 0); }
      

      The Eval function UPPER is called twice for each record.

      This should be optimized so that the UPPER is called only once for each record

        Attachments

        1. PIG-3000-6.patch
          23 kB
          Mona Chitnis
        2. unit_tests.patch
          10 kB
          Mona Chitnis

          Issue Links

            Activity

              People

              • Assignee:
                rohini Rohini Palaniswamy
                Reporter:
                rding Richard Ding
              • Votes:
                0 Vote for this issue
                Watchers:
                9 Start watching this issue

                Dates

                • Created:
                  Updated: