[ 
https://issues.apache.org/jira/browse/PIG-2248?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Johnny Zhang updated PIG-2248:
------------------------------

    Status: Patch Available  (was: Open)

with this patch, the Pig will throw warning message when macro has the same 
name as builtin UDF (all classes under package org.apache.pig.builtin)

I tested it with two macro defined in one Pig script, there is only one warning 
message for each macro. The message looks like
{noformat}
[main] WARN  org.apache.pig.parser.PigMacro - macro name 'COUNT' masks a 
builtin UDF org.apache.pig.builtin.COUNT
[main] WARN  org.apache.pig.parser.PigMacro - macro name 'ABS' masks a builtin 
UDF org.apache.pig.builtin.ABS
{noformat}
                
> Pig parser does not detect when a macro name masks a UDF name
> -------------------------------------------------------------
>
>                 Key: PIG-2248
>                 URL: https://issues.apache.org/jira/browse/PIG-2248
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.9.0
>            Reporter: Alan Gates
>            Priority: Minor
>         Attachments: PIG-2248.patch.txt
>
>
> Pig accepts a macro like:
> {code}
> define COUNT(in_relation, min_gpa) returns c {
>                            b = filter $in_relation by gpa >= $min_gpa;
>                            $c = foreach b generate age, name;
>                        }
> {code}
> This should produce a warning that it is masking a UDF.

--
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

Reply via email to