Skip to content

Commit

Permalink
PIG-5403: streaming job stuck with script failure when combined with …
Browse files Browse the repository at this point in the history
…ORDER BY (knoguchi)

git-svn-id: https://svn.apache.org/repos/asf/pig/trunk@1881193 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
Koji Noguchi committed Aug 25, 2020
1 parent 0b2066a commit e22fcb2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ OPTIMIZATIONS

BUG FIXES

PIG-5403: streaming job stuck with script failure when combined with ORDER BY (knoguchi)

PIG-5362: Parameter substitution of shell cmd results doesn't handle backslash addendum (szita)

PIG-5395: Pig build is failing due to maven repo access point change (szita)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ public Result getNextTuple() throws ExecException {
Result res = null;
while (rowProcessed < numSamples) {
res = processInput();
if (res.returnStatus == POStatus.STATUS_OK) {
if (res.returnStatus == POStatus.STATUS_ERR) {
return res;
} else if (res.returnStatus == POStatus.STATUS_OK) {
samples[(int)rowProcessed] = res;
rowProcessed++;
} else if (res.returnStatus == POStatus.STATUS_NULL) {
Expand All @@ -125,7 +127,9 @@ public Result getNextTuple() throws ExecException {
while (true) {
// pick this as sample
res = processInput();
if (res.returnStatus == POStatus.STATUS_NULL) {
if (res.returnStatus == POStatus.STATUS_ERR) {
return res;
} else if (res.returnStatus == POStatus.STATUS_NULL) {
continue;
} else if (res.returnStatus != POStatus.STATUS_OK) {
break;
Expand Down
13 changes: 12 additions & 1 deletion test/e2e/pig/tests/negative.conf
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ B = stream A through CMD;
store B into ':OUTPATH:';\,
'expected_err_regex' => "failed with exit status: 2",
},
{
{
'num' => 5,
'execonly' => 'mapred,tez',
'pig' => q\
Expand All @@ -469,6 +469,17 @@ C = stream A through BADCMD;
store B into ':OUTPATH:.1';
store C into ':OUTPATH:.2';\,
'expected_err_regex' => "failed with exit status: 1|Error while reading from POStream and passing it to the streaming",
},
{
'num' => 6,
'execonly' => 'mapred,tez',
'pig' => q\
define BADCMD `perl PigStreamingBad.pl middle` ship(':SCRIPTHOMEPATH:/PigStreamingBad.pl');
A = load ':INPATH:/singlefile/studenttab10k';
B = stream A through BADCMD;
C = ORDER B by *;
store C into ':OUTPATH:.1';\,
'expected_err_regex' => "failed with exit status: 2|Error while reading from POStream and passing it to the streaming",
},

]
Expand Down

0 comments on commit e22fcb2

Please sign in to comment.