You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Lucy Cunningham (JIRA)" <ji...@apache.org> on 2012/10/12 22:09:02 UTC

[jira] [Created] (PIG-2969) Can't get simple macro with two return values to work

Lucy Cunningham created PIG-2969:
------------------------------------

             Summary: Can't get simple macro with two return values to work
                 Key: PIG-2969
                 URL: https://issues.apache.org/jira/browse/PIG-2969
             Project: Pig
          Issue Type: Bug
          Components: piggybank
    Affects Versions: 0.11
            Reporter: Lucy Cunningham


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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (PIG-2969) Can't get simple macro with two return values to work

Posted by "Lucy Cunningham (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/PIG-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483596#comment-13483596 ] 

Lucy Cunningham commented on PIG-2969:
--------------------------------------

Is there any news on this?
                
> Can't get simple macro with two return values to work
> -----------------------------------------------------
>
>                 Key: PIG-2969
>                 URL: https://issues.apache.org/jira/browse/PIG-2969
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.11
>            Reporter: Lucy Cunningham
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (PIG-2969) Can't get simple macro with two return values to work

Posted by "Lucy Cunningham (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/PIG-2969?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Lucy Cunningham resolved PIG-2969.
----------------------------------

    Resolution: Not A Problem

Seems to be an issue with the documentation - removing curly brackets around the returns aliases works fine.
                
> Can't get simple macro with two return values to work
> -----------------------------------------------------
>
>                 Key: PIG-2969
>                 URL: https://issues.apache.org/jira/browse/PIG-2969
>             Project: Pig
>          Issue Type: Bug
>          Components: piggybank
>    Affects Versions: 0.11
>            Reporter: Lucy Cunningham
>
> 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

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira