You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pig.apache.org by "Vivek Padmanabhan (Created) (JIRA)" <ji...@apache.org> on 2012/02/21 18:20:34 UTC
[jira] [Created] (PIG-2545) Embeded Pig returns a different error
code than what generated from python
Embeded Pig returns a different error code than what generated from python
---------------------------------------------------------------------------
Key: PIG-2545
URL: https://issues.apache.org/jira/browse/PIG-2545
Project: Pig
Issue Type: Bug
Affects Versions: 0.9.1
Reporter: Vivek Padmanabhan
If i have a Pig script embedded in python (0.9 and above) and the python script exits with an exit
code , then Pig exits with a different error code.
To illustrate consider the below script;
{code}
#!/usr/bin/python
import sys
from org.apache.pig.scripting import Pig
Q = Pig.compile(""" sh bash -c 'echo DATADATE=20110101 > param_20110101.txt' """)
result = Q.bind().runSingle()
sys.exit(10);
if result.isSuccessful() :
print 'Pig job succeeded'
else :
print 'Faled'
{code}
{code}
echo $?
6
{code}
Here the result should have been '10' instead of '6' . Please correct me if the expectation is otherwise.
--
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-2545) Embeded Pig returns a different error
code than what generated from python
Posted by "Daniel Dai (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13213105#comment-13213105 ]
Daniel Dai commented on PIG-2545:
---------------------------------
It is expected Pig will reinterpret the error code (See org.apache.pig.ReturnCode). PIG-2543 is the real problem which we didn't check the status code for sh command in a right way.
> Embeded Pig returns a different error code than what generated from python
> ---------------------------------------------------------------------------
>
> Key: PIG-2545
> URL: https://issues.apache.org/jira/browse/PIG-2545
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.9.1
> Reporter: Vivek Padmanabhan
>
> If i have a Pig script embedded in python (0.9 and above) and the python script exits with an exit
> code , then Pig exits with a different error code.
> To illustrate consider the below script;
> {code}
> #!/usr/bin/python
> import sys
> from org.apache.pig.scripting import Pig
> Q = Pig.compile(""" sh bash -c 'echo DATADATE=20110101 > param_20110101.txt' """)
> result = Q.bind().runSingle()
> sys.exit(10);
> if result.isSuccessful() :
> print 'Pig job succeeded'
> else :
> print 'Faled'
> {code}
> {code}
> echo $?
> 6
> {code}
> Here the result should have been '10' instead of '6' . Please correct me if the expectation is otherwise.
--
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-2545) Embeded Pig returns a different error
code than what generated from python
Posted by "Vivek Padmanabhan (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIG-2545?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Vivek Padmanabhan resolved PIG-2545.
------------------------------------
Resolution: Not A Problem
Thanks Daniel for this information.Sorry for the trouble.
> Embeded Pig returns a different error code than what generated from python
> ---------------------------------------------------------------------------
>
> Key: PIG-2545
> URL: https://issues.apache.org/jira/browse/PIG-2545
> Project: Pig
> Issue Type: Bug
> Affects Versions: 0.9.1
> Reporter: Vivek Padmanabhan
>
> If i have a Pig script embedded in python (0.9 and above) and the python script exits with an exit
> code , then Pig exits with a different error code.
> To illustrate consider the below script;
> {code}
> #!/usr/bin/python
> import sys
> from org.apache.pig.scripting import Pig
> Q = Pig.compile(""" sh bash -c 'echo DATADATE=20110101 > param_20110101.txt' """)
> result = Q.bind().runSingle()
> sys.exit(10);
> if result.isSuccessful() :
> print 'Pig job succeeded'
> else :
> print 'Faled'
> {code}
> {code}
> echo $?
> 6
> {code}
> Here the result should have been '10' instead of '6' . Please correct me if the expectation is otherwise.
--
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