You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Julien Le Dem (Created) (JIRA)" <ji...@apache.org> on 2011/10/13 20:49:11 UTC
[jira] [Created] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
---------------------------------------------------------------------------------------------------------------------------
Key: PIG-2318
URL: https://issues.apache.org/jira/browse/PIG-2318
Project: Pig
Issue Type: Improvement
Components: impl
Reporter: Julien Le Dem
Assignee: Julien Le Dem
This is related to PIG-2010 with a slightly different approach
https://issues.apache.org/jira/browse/PIG-2010
Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Alan Gates (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132184#comment-13132184 ]
Alan Gates commented on PIG-2318:
---------------------------------
This patch does not create any new functionality, correct? So running existing tests would seem to suffice. I'm happy to do that with this patch if you'd like.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132876#comment-13132876 ]
Julien Le Dem commented on PIG-2318:
------------------------------------
Alan, does the "testudf.jar" get build for the regular unit-test run? If yes I have a unit test that reproduces this.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch, PIG-2318_3.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Updated] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julien Le Dem updated PIG-2318:
-------------------------------
Attachment: PIG-2318_2.patch
PIG-2318_2.patch addresses the comments. I'm now streaming jars from the URL to HDFS instead of copyFromLocal, so that would work from any URL. I don't know for the Vector for skipJars, but it seems that before my change it was a static list, so Vector vs ArrayList does not seem necessary.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Dmitriy V. Ryaboy (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134680#comment-13134680 ]
Dmitriy V. Ryaboy commented on PIG-2318:
----------------------------------------
LGTM. +1, thanks Julien.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch, PIG-2318_3.patch, PIG-2318_4.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Updated] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julien Le Dem updated PIG-2318:
-------------------------------
Attachment: PIG-2318.patch
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Resolved] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julien Le Dem resolved PIG-2318.
--------------------------------
Resolution: Won't Fix
I'm closing this as won't fix because using a different classloader on the backend has too many side effects. In particular HBaseLoader included in the pig jar but its dependencies not, or other subtle things. Instead I will update PIG-2010 using the distributed cache.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch, PIG-2318_3.patch, PIG-2318_4.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Dmitriy V. Ryaboy (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132047#comment-13132047 ]
Dmitriy V. Ryaboy commented on PIG-2318:
----------------------------------------
Looks good to me, +1.
I suppose we are supposed to test this sort of thing using the e2e framework?
Alan?
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Dmitriy V. Ryaboy (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13136382#comment-13136382 ]
Dmitriy V. Ryaboy commented on PIG-2318:
----------------------------------------
Looks like there's an edge case of a class in Pig needing a class found in the pig jar, but not bundled into the job jar thanks to Pigs rebundling (and packaging only prefixed classes). This affects some uses of HBaseStorage. We're working on a fix (suspect just registering the pig jar itself will work. Or not rebundling the pig jar in the first place? Why do we do that?)
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch, PIG-2318_3.patch, PIG-2318_4.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Dmitriy V. Ryaboy (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13126817#comment-13126817 ]
Dmitriy V. Ryaboy commented on PIG-2318:
----------------------------------------
Good start, Julien.
public void setExtraJarsInDistributedCache -- seems like we'll need an additional addJarToDistributedCache method, to avoid forcing function users to rewrite the array every time themselves.
log.info("Adding jar to DistributedCache: " + jar); -- this should be debug level
You special case file and hdfs protocols specifically. What happens to other protocols? I believe the way we deal with hdfs jars is we copy them over to the local fs in order to drop them onto the local classpath, anyway. Presumably that'll work the same way for s3n://, for example. We could at least treat those as local jars and pick up the local copy to ship to the cluster?
Not related to your change, but any ideas why skipJars is a Vector? Seems like that's not necessary...
Some of your comments such as the one about the PigContext constructor should probably be in javadoc format so they make it out to the world.. knowing what does and does not get serialized would be handy.
Did you notice an appreciable improvement in startup time when using this on our cluster?
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132857#comment-13132857 ]
Julien Le Dem commented on PIG-2318:
------------------------------------
It turns out I need to handle a special case for Stores.
Thanks Alan! I'm looking into it.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Updated] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julien Le Dem updated PIG-2318:
-------------------------------
Attachment: PIG-2318_3.patch
PIG-2318_3.patch handles the special case for Storer.
It turns out that the PigOutputFormat did not deserialize the PigContext. Which explains why the classloader was not initialized.
Now the PigOutputFormat initializes the PigContext first.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch, PIG-2318_3.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Updated] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Julien Le Dem (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Julien Le Dem updated PIG-2318:
-------------------------------
Attachment: PIG-2318_4.patch
PIG-2318_4.patch fixes an issue when classes loaded through REGISTER would use the hadoop Configuration object to load resources (in the System classloader when the registered jars and their resources are in the URLClassloader). In particular This happened when using HBaseConfiguration.create() from a UDF.
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch, PIG-2318_3.patch, PIG-2318_4.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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
[jira] [Commented] (PIG-2318) Push extra jars to distributed cache
and use the classloader enxtension mechanism in PigContext to load them on
the backend
Posted by "Alan Gates (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2318?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13132216#comment-13132216 ]
Alan Gates commented on PIG-2318:
---------------------------------
When running the following script (from e2e test LoadBinStorage_1):
{code}
register ./lib/java/testudf.jar;a = load '/user/pig/tests/data/singlefile/studenttab10k' as (name, age, gpa);
b = foreach a generate name, org.apache.pig.test.udf.evalfunc.Swap(name, age), TOKENIZE((chararray)name), org.apache.pig.test.udf.evalfunc.CreateMap((chararray)name, age);
store b into '/user/pig/out/hortonal.1319153438/LoaderBinStorage_1.out.intermediate' using BinStorage();
c = load '/user/pig/out/hortonal.1319153438/LoaderBinStorage_1.out.intermediate' using BinStorage();
store c into '/user/pig/out/hortonal.1319153438/LoaderBinStorage_1.out' using org.apache.pig.test.udf.storefunc.StringStore();
{code}
the job fails to start, with the following exception:
{code}
java.lang.RuntimeException: Cannot instantiate: org.apache.pig.test.udf.storefunc.StringStore
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:531)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getStoreFunc(POStore.java:232)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.getCommitters(PigOutputCommitter.java:87)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.<init>(PigOutputCommitter.java:69)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.getOutputCommitter(PigOutputFormat.java:279)
at org.apache.hadoop.mapred.Task.initialize(Task.java:507)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:353)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.pig.test.udf.storefunc.StringStore using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]
at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:516)
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:528)
... 11 more
java.lang.RuntimeException: Cannot instantiate: org.apache.pig.test.udf.storefunc.StringStore
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:531)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getStoreFunc(POStore.java:232)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.getCommitters(PigOutputCommitter.java:87)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.<init>(PigOutputCommitter.java:69)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.getOutputCommitter(PigOutputFormat.java:279)
at org.apache.hadoop.mapred.Task.initialize(Task.java:507)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:353)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.pig.test.udf.storefunc.StringStore using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]
at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:516)
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:528)
... 11 more
java.lang.RuntimeException: Cannot instantiate: org.apache.pig.test.udf.storefunc.StringStore
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:531)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getStoreFunc(POStore.java:232)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.getCommitters(PigOutputCommitter.java:87)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.<init>(PigOutputCommitter.java:69)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.getOutputCommitter(PigOutputFormat.java:279)
at org.apache.hadoop.mapred.Task.initialize(Task.java:507)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:353)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.pig.test.udf.storefunc.StringStore using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]
at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:516)
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:528)
... 11 more
java.lang.RuntimeException: Cannot instantiate: org.apache.pig.test.udf.storefunc.StringStore
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:531)
at org.apache.pig.backend.hadoop.executionengine.physicalLayer.relationalOperators.POStore.getStoreFunc(POStore.java:232)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.getCommitters(PigOutputCommitter.java:87)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputCommitter.<init>(PigOutputCommitter.java:69)
at org.apache.pig.backend.hadoop.executionengine.mapReduceLayer.PigOutputFormat.getOutputCommitter(PigOutputFormat.java:279)
at org.apache.hadoop.mapred.Task.initialize(Task.java:507)
at org.apache.hadoop.mapred.MapTask.run(MapTask.java:353)
at org.apache.hadoop.mapred.Child$4.run(Child.java:255)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:396)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1059)
at org.apache.hadoop.mapred.Child.main(Child.java:249)
Caused by: org.apache.pig.backend.executionengine.ExecException: ERROR 1070: Could not resolve org.apache.pig.test.udf.storefunc.StringStore using imports: [, org.apache.pig.builtin., org.apache.pig.impl.builtin.]
at org.apache.pig.impl.PigContext.resolveClassName(PigContext.java:516)
at org.apache.pig.impl.PigContext.instantiateFuncFromSpec(PigContext.java:528)
... 11 more
{code}
> Push extra jars to distributed cache and use the classloader enxtension mechanism in PigContext to load them on the backend
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: PIG-2318
> URL: https://issues.apache.org/jira/browse/PIG-2318
> Project: Pig
> Issue Type: Improvement
> Components: impl
> Reporter: Julien Le Dem
> Assignee: Julien Le Dem
> Attachments: PIG-2318.patch, PIG-2318_2.patch
>
>
> This is related to PIG-2010 with a slightly different approach
> https://issues.apache.org/jira/browse/PIG-2010
> Currently Pig bundles up all dependencies in a single jar which is a lot of overhead when there are a lot of dependencies and short lived jobs. This patch instead pushes the dependencies to distributed cache and uses the PigContext classloading mechanism to make the UDFs available.
> Possible improvements: push jars to HDFS/distributed cache only once per script. have a cache on HDFS to avoid repeatedly pushing jars to HDFS.
--
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