[ 
https://issues.apache.org/jira/browse/PIG-2244?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13666864#comment-13666864
 ] 

Xuefu Zhang commented on PIG-2244:
----------------------------------

@Johnny Your patch might solve this particular problem, but the problem in 
general may not have been solved. For instance, what if "a" instead of 'a' is 
passed to the macro invocation.

The problem we have been seeing may be just the symptom of a bigger problem: 
what's the semantics of the quotes in macro invocation. That is, is x = 
simple_macro('a', '3.0', '40') different from x = simple_macro('a', 3.0, 40)? 
Currently, the two generate the same expanded script, but this may not be what 
user intended. '3.0' vs 3.0, and similarly '40' vs 40 are different data types. 
Treating them the same will certainly cause confusion and ambiguity.

'a' vs a posts a bigger problem, which is the root cause of the problem.

In short, I don't think we should remove the quotes thus treat 'a' and 'a' or 
'40' and 40 the same. Unfortunately, current macro param substitution 
implementation uses PigFileParser, which unquotes any literal that might have 
quotes. PigFileParse is javacc based, which was exactly what we liked to 
replace with Antlr. Fixing the quote problem thus has a much bigger scope.

                
> Macros cannot be passed relation names
> --------------------------------------
>
>                 Key: PIG-2244
>                 URL: https://issues.apache.org/jira/browse/PIG-2244
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>    Affects Versions: 0.9.0
>            Reporter: Alan Gates
>            Assignee: Johnny Zhang
>            Priority: Minor
>         Attachments: PIG-2244.patch.txt, PIG-2244.patch.txt, 
> PIG-2244.patch.txt
>
>
> If an alias is passed quoted, it gets expanded as if it were an alias in the 
> macro, which leads to a very strange error message.

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