Pig
  1. Pig
  2. PIG-2681

TestDriverPig.countStores() does not correctly count the number of stores for pig scripts using variables for the alias

    Details

    • Type: Test Test
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 0.9.0, 0.9.1, 0.9.2, 0.10.0
    • Fix Version/s: 0.13.0
    • Component/s: e2e harness
    • Labels:
      None

      Description

      For pig macros where the out parameter is referenced in a store statement, the TestDriveP.countStores() does not correctly count the number of stores:

      For example, the store will not be counted in :

      define myMacro(in1,in2) returns A

      { A = load '$in1' using PigStorage('$delimeter') as (intnum1000: int,id: int,intnum5: int,intnum100: int,intnum: int,longnum: long,floatnum: float,doublenum: double); store $A into '$out'; }

      countStores() matches with:
      $count = $q[$i] =~ /store\s[a-zA-Z][a-zA-Z0-9_]*\s+into/i;

      Since the alias has a special character "$" it doesn't count it and the test fails.

      Need to change this to:

      $count = $q[$i] =~ /store\s(\$)?[a-zA-Z][a-zA-Z0-9_]*\s+into/i;

      I'll submit a patch shortly.

      1. PIG-2681.patch
        1 kB
        Araceli Henley

        Activity

          People

          • Assignee:
            Unassigned
            Reporter:
            Araceli Henley
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:

              Development