Johannes Schwenk created PIG-2832:
-------------------------------------
Summary: 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
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:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira