You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Prashant Kommireddi (JIRA)" <ji...@apache.org> on 2012/10/23 10:27:15 UTC

[jira] [Assigned] (PIG-2832) org.apache.pig.pigunit.pig.PigServer does not initialize udf.import.list of PigContext

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

Prashant Kommireddi reassigned PIG-2832:
----------------------------------------

    Assignee: Prashant Kommireddi
    
> org.apache.pig.pigunit.pig.PigServer does not initialize udf.import.list of PigContext
> --------------------------------------------------------------------------------------
>
>                 Key: PIG-2832
>                 URL: https://issues.apache.org/jira/browse/PIG-2832
>             Project: Pig
>          Issue Type: Bug
>    Affects Versions: 0.10.0
>         Environment: pig-0.10.0, Hadoop 2.0.0-cdh4.0.1 on Kubuntu 12.04 64Bit.
>            Reporter: Johannes Schwenk
>            Assignee: Prashant Kommireddi
>         Attachments: PIG-2832.patch
>
>
> PigServer does not initialize udf.import.list. 
> So, if you have a pig script that uses UDFs and want to pass the udf.import.list via a property file you can do so using the -propertyFile command line to pig. But you should also be able to do it using pigunits PigServer class that already has the corresponding contructor, e.g. doing something similar to :
> {code}
> Properties props = new Properties();
> props.load(new FileInputStream("./testdata/test.properties"));
> pig = new PigServer(ExecType.LOCAL, props);
> String[] params = {"data_dir=testdata"};
> test = new PigTest("test.pig", params, pig, cluster);
> test.assertSortedOutput("aggregated", new File("./testdata/expected.out"));
> {code}
> While udf.import.list is defined in test.properties and test.pig uses names of UDFs which should be resolved using that list.
> This does not work!
> I'd say the org.apache.pig.PigServer class is the problem. It should initialize the import list of the PigContext. 
> {code}
> if(properties.get("udf.import.list") != null) {
>     PigContext.initializeImportList((String)properties.get("udf.import.list"));
> }{code}
> Right now this is done in org.apache.pig.Main.

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