18 Jun 2012 15:24
[Created] (PIG-2760) resources added with a relative path are added to the JobXXXX jar file under their absolute path
Mathias Herberts created PIG-2760:
-------------------------------------
Summary: resources added with a relative path are added to the JobXXXX jar file under their absolute path
Key: PIG-2760
URL: https://issues.apache.org/jira/browse/PIG-2760
Project: Pig
Issue Type: Bug
Affects Versions: 0.10.0
Reporter: Mathias Herberts
When registering a local resource using a relative path, the resource is added to the JobXXXX jar under its
absolute path.
If a pig script contains the following:
REGISTER etc/foo;
and is executed from a directory /PATH/TO/DIR, the JobXXXX jar file will contain the following:
/PATH/TO/DIR/etc/foo
instead of
etc/foo
which was the previous behavior
--
This message is automatically generated by JIRA.
(Continue reading)
Thanks for explaining!
I like your patch because it solves all the cases that I can think of. Just a minor comment. Can't you collapse
the following lines of code into a single line?
{code}
String nameInJar = cp.startsWith(cwd) ? cp.substring(cwd.length() + 1) : cp;
// Strip leading path.sep
if (nameInJar.startsWith("/")) {
nameInJar = nameInJar.substring(1);
}
{code}
=>
{code}
String nameInJar = cp.startsWith(cwd) ? cp.substring(cwd.length() + 1) : cp.substring(1);
{code}
Given that cp is always going to be an absolute path (as a relative path is converted to an absolute one by
RSS Feed