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

Cheolsoo Park commented on PIG-3359:
------------------------------------

On a second thought, I think we should change the condition for the warnings as 
follows:
{code}
-        if (param_val.containsKey(key)) {
+        if (param_val.containsKey(key) && !param_val.get(key).equals(val)) {
             if (overwrite) {
                 log.warn("Warning : Multiple values found for " + key + ". 
Using value " + val);
             } else {
{code}
We shouldn't lower the log level. Instead, we should print it only if there are 
multiple values for the same key. Do you agree?
                
> Register Statements and Param Substitution in Macros
> ----------------------------------------------------
>
>                 Key: PIG-3359
>                 URL: https://issues.apache.org/jira/browse/PIG-3359
>             Project: Pig
>          Issue Type: Bug
>          Components: parser
>            Reporter: Jonathan Packer
>            Assignee: Jonathan Packer
>         Attachments: PIG-3359_test.tar.gz, PIG-3359-v1.diff, 
> PIG-3359-v2.diff, PIG-3359-v3.diff, PIG-3359-v3-test-failures.txt, 
> PIG-3359-v4.diff, PIG-3359-v5.diff, PIG-3359-v6.diff
>
>
> There are some gaps in the functionality of macros that I've made a patch to 
> address. The goal is to provide everything you'd need to make reusable 
> algorithms libraries.
> 1. You can't register udfs inside a macro
> 2. Paramater substitutions aren't done inside macros
> 3. Resources (including macros) should not be redundantly acquired if they 
> are already present.
> Rohini's patch https://issues.apache.org/jira/browse/PIG-3204 should address 
> problem 3 where Pig reparses everything every time it reads a line, but there 
> still would be a problem if two separate files import the same macro / udf 
> file.
> To get this working, I moved methods for registering jars/udfs and param 
> substitution from PigServer to PigContext so they can be accessed in 
> QueryParserDriver which processes macros (QPD was already passed a PigContext 
> reference). Is that ok?

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