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

Can't get simple macro with two return values to work

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Not A Problem
    • 0.11
    • None
    • piggybank
    • None

    Description

      Hi, I followed the documentation to try and write a pig macro with two output relations, but i'm getting errors:

      define mymacro (a, b)
      returns

      {c, d}

      {
      $c = $a;
      $d = $b;
      };

      e = load 'thing' as (x:int);
      f = load 'thing' as (x:int);

      g,h = mymacro(e,f);

      dump g;
      dump h;
      ~
      ~

      Gives me error:

      ERROR 2999: Unexpected internal error. Undefined parameter : c

      java.lang.RuntimeException: Undefined parameter : c
      at org.apache.pig.tools.parameters.PreprocessorContext.substitute(PreprocessorContext.java:232)
      at org.apache.pig.tools.parameters.PigFileParser.input(PigFileParser.java:65)
      at org.apache.pig.tools.parameters.PigFileParser.Parse(PigFileParser.java:43)
      at org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor.parsePigFile(ParameterSubstitutionPreprocessor.java:105)
      at org.apache.pig.tools.parameters.ParameterSubstitutionPreprocessor.genSubstitutedFile(ParameterSubstitutionPreprocessor.java:98)
      at org.apache.pig.Main.runParamPreprocessor(Main.java:778)
      at org.apache.pig.Main.run(Main.java:568)
      at org.apache.pig.Main.main(Main.java:154)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:186)

      Is this something that I am doing wrong or is there a bug?

      Thanks!
      Lucy

      Attachments

        Activity

          People

            Unassigned Unassigned
            lcunningham Lucy Cunningham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: