Home | About | Sematext search-lucene.com search-hadoop.com
 Search Hadoop and all its subprojects:

Switch to Threaded View
Pig, mail # user - pig shell script does not check for PIG_HOME being set prior to exporting


Copy link to this message
-
Re: pig shell script does not check for PIG_HOME being set prior to exporting
Robert 2013-03-11, 01:24
A JIRA issue has been created and the patch added as an attachment:

https://issues.apache.org/jira/browse/PIG-3244

________________________________
 From: Rohini Palaniswamy <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]; Robert <[EMAIL PROTECTED]>
Sent: Monday, March 4, 2013 5:44 AM
Subject: Re: pig shell script does not check for PIG_HOME being set prior to exporting
 
We should make PIG_HOME configurable. Can you create a jira and upload a
patch?

Thanks,
Rohini
On Sat, Mar 2, 2013 at 6:14 PM, Robert <[EMAIL PROTECTED]> wrote:

> It looks like the pig shell script in v0.11 exports PIG_HOME without first
> checking to see if it already exists.
>
> from line 78 in <path>/bin/pig:
> # the root of the Pig installation
> export PIG_HOME=`dirname "$this"`/..
>
> Going through the script it appears most env variables are checked prior
> to setting, but not this one.  Is there a reason why?
>
> Background: I ask this because I was getting an error resolving the path
> to pig.jar.  From what I gather it is because I use a symbolic link in
> /usr/local/bin to the pig script instead of modifying my PATH.  This meant
> `$this` in the bash script returned the path to /usr/local/bin instead of
> /usr/local/pig-0.11.0/bin.
>
> I modified my local version to the following:
>
> # the root of the Pig installation
> if [ -z "$PIG_HOME" ]; then
>     export PIG_HOME=`dirname "$this"`/..
> fi
>
> Is this something the script should have in it, or am I operating outside
> of the expected scenario?
>
> Thanks,
> Robert