pig-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheolsoo Park (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (PIG-3359) Register Statements and Param Substitution in Macros
Date Tue, 09 Jul 2013 19:59:49 GMT

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

Cheolsoo Park edited comment on PIG-3359 at 7/9/13 7:59 PM:
------------------------------------------------------------

[~jpacker], I have one question for you.
{quote}
I moved some methods from PigServer to PigContext, which QPD has an instance of.
{quote}
Why can't you construct a PigServer instance w/ PigContext inside QPD instead of moving those
methods? That seems like a pattern being used at several places. For example,
{code:title=GroovyScriptEngine.java}
    PigServer pigServer = new PigServer(context, false);
    String groovyJar = getJarPath(groovy.util.GroovyScriptEngine.class);
    if (null != groovyJar) {
        pigServer.registerJar(groovyJar);
    }
{code}
To me, "pigServer.registerCode()" reads better than "pigContext.registerCode()", so I prefer
not moving them to PigContext. What do you think? Please feel free to disagree with me.
                
      was (Author: cheolsoo):
    [~jpacker], I have one question for you.
{quote}
I moved some methods from PigServer to PigContext, which QPD has an instance of.
{quote}
Why can't you construct a PigServer instance w/ PigContext inside QPD instead of moving those
methods? That seems like a pattern being used at several places. For example,
{code:title=GroovyScriptEngine.java}
    PigServer pigServer = new PigServer(context, false);
    String groovyJar = getJarPath(groovy.util.GroovyScriptEngine.class);
    if (null != groovyJar) {
        pigServer.registerJar(groovyJar);
    }
{code}
To me, "pigServer.registerCode()" reads better than "pigContext.registerCode()", so I prefer
to not moving them to PigContext. What do you think? Please feel free to disagree with me.
                  
> 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
>
>
> 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

Mime
View raw message